public final class DataQuery extends Object
Constructor and Description |
---|
DataQuery(char separator,
String path)
Constructs a query using the given separator character and path.
|
DataQuery(List<String> parts)
Constructs a query using the given parts.
|
DataQuery(String... parts)
Constructs a query using the given parts.
|
Modifier and Type | Method and Description |
---|---|
String |
asString(char separator)
Gets this query as a string separated by the given separator character.
|
String |
asString(String separator)
Gets this query as a string separated by the given separator.
|
boolean |
equals(Object obj) |
List<String> |
getParts()
Gets the parts that make up this query.
|
List<DataQuery> |
getQueryParts()
Returns the parts of this query as individual queries.
|
int |
hashCode() |
static DataQuery |
of()
Gets an empty
DataQuery . |
static DataQuery |
of(char separator,
String path)
Constructs a query using the given separator character and path.
|
static DataQuery |
of(List<String> parts)
Constructs a query using the given parts.
|
static DataQuery |
of(String... parts)
Constructs a query using the given parts.
|
DataQuery |
then(DataQuery that)
Returns a new query that is made up of this query's parts followed by the
given query's parts.
|
String |
toString() |
public DataQuery(char separator, String path)
As an example, new DataQuery('/', "a/b/c")
and
new DataQuery('.', "a.b.c")
represent the same path but are
constructed using different separators.
separator
- The separatorpath
- The pathpublic DataQuery(String... parts)
parts
- The partspublic static DataQuery of()
DataQuery
. This query is constant and never
changes and therefor can be called multiple times returning the
same instance.public static DataQuery of(char separator, String path)
As an example, new DataQuery('/', "a/b/c")
and
new DataQuery('.', "a.b.c")
represent the same path but are
constructed using different separators.
separator
- The separatorpath
- The pathDataQuery
public static DataQuery of(String... parts)
parts
- The partsDataQuery
public static DataQuery of(List<String> parts)
parts
- The partsDataQuery
public List<String> getParts()
public DataQuery then(DataQuery that)
that
- The given query to follow this onepublic List<DataQuery> getQueryParts()
public String asString(String separator)
separator
- The separatorpublic String asString(char separator)
separator
- The separator