public final class Identifier extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Identifier.IdentifierConsumer
Represents an operation that accepts identifier key parts (name, value and
target type ) defining a
contract to consume Identifier values. |
Modifier and Type | Method and Description |
---|---|
static Identifier |
empty()
Returns an empty
Identifier . |
boolean |
equals(Object o) |
void |
forEach(Identifier.IdentifierConsumer consumer)
Performs the given action for each element of the
Identifier until all elements have been processed or the
action throws an exception. |
static Identifier |
from(Map<SqlIdentifier,Object> map)
Creates an
Identifier from a Map of name to value tuples. |
Collection<org.springframework.data.relational.domain.Identifier.SingleIdentifierValue> |
getParts() |
int |
hashCode() |
static Identifier |
of(SqlIdentifier name,
Object value,
Class<?> targetType)
|
int |
size()
Returns the number of key parts in this collection.
|
Map<SqlIdentifier,Object> |
toMap()
Returns a
Map containing the identifier name to value tuples. |
String |
toString() |
Identifier |
withPart(SqlIdentifier name,
Object value,
Class<?> targetType)
Creates a new
Identifier from the current instance and sets the value for key . |
public static Identifier empty()
Identifier
.Identifier
.public static Identifier of(SqlIdentifier name, Object value, Class<?> targetType)
name
- must not be null or empty.value
- targetType
- must not be null.Identifier
for name
, value
, and a target type
.public static Identifier from(Map<SqlIdentifier,Object> map)
Identifier
from a Map
of name to value tuples.map
- must not be null.Identifier
from a Map
of name to value tuples.public Identifier withPart(SqlIdentifier name, Object value, Class<?> targetType)
Identifier
from the current instance and sets the value for key
. Existing key
definitions for name
are overwritten if they already exist.name
- must not be null or empty.value
- targetType
- must not be null.Identifier
containing all existing keys and the key part for name
, value
, and a
target type
.public Map<SqlIdentifier,Object> toMap()
Map
containing the identifier name to value tuples.Map
containing the identifier name to value tuples.public Collection<org.springframework.data.relational.domain.Identifier.SingleIdentifierValue> getParts()
key parts
.public void forEach(Identifier.IdentifierConsumer consumer)
Identifier
until all elements have been processed or the
action throws an exception. Unless otherwise specified by the implementing class, actions are performed in the
order of iteration (if an iteration order is specified). Exceptions thrown by the action are relayed to the caller.consumer
- the action, must not be null.public int size()
Copyright © 2017–2020 Pivotal Software, Inc.. All rights reserved.