Package org.pipservices3.commons.data
Class ProjectionParams
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,List<String>
,RandomAccess
Defines projection parameters with list if fields to include into query results.
The parameters support two formats: dot format and nested format.
The dot format is the standard way to define included fields and subfields using
dot object notation: "field1,field2.field21,field2.field22.field221"
As alternative the nested format offers a more compact representation:
"field1,field2(field21,field22(field221))"
### Example ###
FilterParams filter = FilterParams.fromTuples("type", "Type1");
PagingParams paging = new PagingParams(0, 100);
ProjectionParams projection = ProjectionParams.fromString("field1,field2(field21,field22)")
myDataClient.getDataByFilter(filter, paging, projection);
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionProjectionParams
(String[] values) Creates a new instance of the projection parameters and assigns its value.ProjectionParams
(AnyValueArray array) Creates a new instance of the projection parameters and assigns its value. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProjectionParams
Converts specified value into ProjectionParams.static ProjectionParams
fromValues
(char delimiter, String... values) Parses comma-separated list of projection fields.static ProjectionParams
fromValues
(String... values) Parses comma-separated list of projection fields.toString()
Gets a string representation of the object.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
ProjectionParams
public ProjectionParams() -
ProjectionParams
Creates a new instance of the projection parameters and assigns its value.- Parameters:
values
- (optional) values to initialize this object.
-
ProjectionParams
Creates a new instance of the projection parameters and assigns its value.- Parameters:
array
- (optional) values to initialize this object.
-
-
Method Details
-
fromValue
Converts specified value into ProjectionParams.- Parameters:
value
- value to be converted- Returns:
- a newly created ProjectionParams.
- See Also:
-
fromValues
Parses comma-separated list of projection fields.- Parameters:
values
- one or more comma-separated lists of projection fields- Returns:
- a newly created ProjectionParams.
-
fromValues
Parses comma-separated list of projection fields.- Parameters:
delimiter
- a certain type of delimitervalues
- one or more comma-separated lists of projection fields- Returns:
- a newly created ProjectionParams.
-
toString
Gets a string representation of the object. The result is a comma-separated list of projection fields "field1,field2.field21,field2.field22.field221"- Overrides:
toString
in classAbstractCollection<String>
- Returns:
- a string representation of the object.
-