Class DataQuery
java.lang.Object
org.spongepowered.api.data.persistence.DataQuery
Represents a query that can be done on views. Queries do not depend on
their separator, it is just a way to construct them.
-
Method Summary
Modifier and TypeMethodDescriptionasString
(char separator) Gets this query as a string separated by the given separator character.Gets this query as a string separated by the given separator.boolean
void
int
hashCode()
iterator()
last()
Gets the last entry of thisDataQuery
.static DataQuery
of()
Gets an emptyDataQuery
.static DataQuery
Constructs a query using the given separator character and path.static DataQuery
Constructs a query using the given parts.static DataQuery
Constructs a query using the given parts.parts()
Gets the parts that make up this query.pop()
Returns aDataQuery
where the last node is "popped" off.popFirst()
Returns aDataQuery
where the first node is "popped" off.Returns the parts of this query as individual queries.Returns a new query that is made up of this query's parts followed by the given query.Returns a new query that is made up of this query's parts followed by the given query's parts.toString()
-
Method Details
-
of
Gets an emptyDataQuery
. This query is constant and never changes and therefor can be called multiple times returning the same instance.- Returns:
- An empty data query
-
of
Constructs a query using the given separator character and path.As an example,
new DataQuery('/', "a/b/c")
andnew DataQuery('.', "a.b.c")
represent the same path but are constructed using different separators.- Parameters:
separator
- The separatorpath
- The path- Returns:
- The newly constructed
DataQuery
-
of
Constructs a query using the given parts.- Parameters:
parts
- The parts- Returns:
- The newly constructed
DataQuery
-
of
Constructs a query using the given parts.- Parameters:
parts
- The parts- Returns:
- The newly constructed
DataQuery
-
parts
Gets the parts that make up this query. The returned list is immutable.- Returns:
- The parts of this query
-
then
Returns a new query that is made up of this query's parts followed by the given query's parts.- Parameters:
that
- The given query to follow this one- Returns:
- The constructed query
-
then
Returns a new query that is made up of this query's parts followed by the given query.- Parameters:
that
- The given query to follow this one- Returns:
- The constructed query
-
queryParts
Returns the parts of this query as individual queries. The returned list is immutable.- Returns:
- The constructed queries
-
pop
Returns aDataQuery
where the last node is "popped" off. If this query is already the top level query, then theof()
is returned.- Returns:
- The next level query
-
popFirst
Returns aDataQuery
where the first node is "popped" off. If this query is already the top level query, then theof()
is returned.- Returns:
- The next level query
-
last
Gets the last entry of thisDataQuery
. If this query is a single entry query or an empty query, it returns itself.- Returns:
- The last entry as a data query, if not already last
-
asString
Gets this query as a string separated by the given separator.- Parameters:
separator
- The separator- Returns:
- This query as a string
-
asString
Gets this query as a string separated by the given separator character.- Parameters:
separator
- The separator- Returns:
- This query as a string
-
toString
-
hashCode
public int hashCode() -
equals
-
iterator
-
forEach
-
spliterator
- Specified by:
spliterator
in interfaceIterable<String>
-