public class ComboKey extends ObjectKey<SimpleKey<?>[]>
Modifier and Type | Field and Description |
---|---|
static char |
SEPARATOR
The single character used to separate key values in a string.
|
static String |
SEPARATOR_STRING
The single character used to separate key values in a string.
|
Constructor and Description |
---|
ComboKey()
Initializes the internal key value to
null . |
ComboKey(ComboKey key)
Creates a ComboKey that is equivalent to key.
|
ComboKey(SimpleKey<?>[] key)
Creates an ComboKey and set its internal representation
|
ComboKey(String key)
Creates an ComboKey and set its internal representation
|
Modifier and Type | Method and Description |
---|---|
void |
appendTo(StringBuilder sb)
Appends a String representation of the key to a buffer.
|
boolean |
equals(Object keyObj)
This method will return true if the conditions for a looseEquals
are met and in addition no parts of the keys are null.
|
int |
getJdbcType()
Returns the JDBC type of the key
as defined in
java.sql.Types . |
int |
hashCode()
if the underlying key array is not null and the first element is
not null this method returns the hashcode of the first element
in the key.
|
boolean |
looseEquals(Object keyObj)
keyObj is equal to this ComboKey if keyObj is a ComboKey, String,
ObjectKey[], or String[] that contains the same information this key
contains.
|
void |
setValue(String keys)
Sets the internal representation using a String of the
form produced by the toString method.
|
String |
toString()
A String that may consist of one section or multiple sections
separated by a colon.
|
public static final char SEPARATOR
public static final String SEPARATOR_STRING
public ComboKey()
null
.public ComboKey(String key)
key
- the key value as Stringpublic ComboKey(SimpleKey<?>[] key)
key
- the key valuepublic ComboKey(ComboKey key)
key
- the key valuepublic void setValue(String keys)
keys
- the key valuespublic int getJdbcType()
java.sql.Types
.getJdbcType
in class ObjectKey<SimpleKey<?>[]>
Types.ARRAY
.public boolean equals(Object keyObj)
public boolean looseEquals(Object keyObj)
keyObj
- the comparison valuepublic void appendTo(StringBuilder sb)
ObjectKey
appendTo
in class ObjectKey<SimpleKey<?>[]>
sb
- the StringBuilder to appendtoString()
public int hashCode()
public String toString()
Each Key is represented by [type N|S|D][value][:]
.
Example:
the ComboKey(StringKey("key1"), NumberKey(2)) is represented as
Skey1:N2:
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.