public class Attribute
extends java.lang.Object
implements xxl.core.io.Convertable
Modifier and Type | Class and Description |
---|---|
static class |
Attribute.DataType
JEPC data types
|
Constructor and Description |
---|
Attribute()
Empty constructor for deserialization
|
Attribute(Attribute attribute)
Copy constructor.
|
Attribute(java.lang.String attributeName,
Attribute.DataType attributeType)
Creates a new attribute.
|
Modifier and Type | Method and Description |
---|---|
void |
clearProperties()
Removes all properties completely.
|
Attribute |
copy()
Copies this attribute.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAttributeName()
Gets the name of the attribute.
|
Attribute.DataType |
getAttributeType()
Gets the data type of the attribute.
|
java.lang.Number |
getMaximumValue()
Returns the maximum value of this attribute.
|
int |
getMaxStringSize()
Returns the maximum string size of this attribute.
|
java.lang.Number |
getMinimumValue()
Returns the minimum value of this attribute.
|
java.lang.String |
getProducerType()
Gets the type of the schema of this attribute.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Gets all properties of the attribute.
|
java.lang.String |
getProperty(java.lang.String key)
Gets the value of a property for a given key.
|
java.lang.String |
getStaticValue()
Gets the static value of this attribute.
|
java.util.List<java.lang.String> |
getValueList()
Returns a list containing all allowed values for
this specific attribute.
|
boolean |
isKey()
Returns true if this attribute is part of the key and false otherwise.
|
boolean |
isNumeric()
Returns true if the type of this attribute is numeric and false otherwise.
|
boolean |
isUnique()
Returns true if this attribute is unique and false otherwise.
|
java.util.Set<java.lang.String> |
propertyNames()
Gets the set of keys of all properties.
|
void |
read(java.io.DataInput dataInput) |
java.lang.String |
removeProperty(java.lang.String key)
Removes a property completely.
|
void |
setAttributeName(java.lang.String attributeName)
Sets the name of the attribute.
|
void |
setAttributeType(Attribute.DataType attributeType)
Sets the data type of the attribute.
|
Attribute |
setIsKey()
Sets the attribute to be part of the key of the corresponding schema.
|
Attribute |
setIsUnique()
Sets the attribute to be unique.
|
Attribute |
setMaximumValue(java.lang.Number value)
Sets the maximum value for this attribute.
|
Attribute |
setMaxStringSize(int maxStringSize)
Sets the maximum string size for this attribute.
|
Attribute |
setMinimumValue(java.lang.Number value)
Sets the minimum value for this attribute.
|
Attribute |
setProducerType(java.lang.String producerType)
Sets the type for the schema of this attribute.
|
Attribute |
setProperty(java.lang.String key,
java.lang.String value)
Sets a property.
|
Attribute |
setStaticValue(java.lang.Object value)
Sets a static value for the attribute.
|
void |
setValueList(java.util.List<java.lang.String> values)
Defines a list of restrictive values for this attribute.
|
java.lang.String |
toString() |
Attribute |
unsetIsKey()
Unsets the attribute to be part of the key of the corresponding schema.
|
Attribute |
unsetIsUnique()
Unsets the attribute to be unique.
|
Attribute |
unsetProducerType()
Unsets the type for the schema of this attribute.
|
Attribute |
unsetStaticValue()
Unsets the static value of the attribute.
|
void |
write(java.io.DataOutput dataOutput) |
public Attribute(java.lang.String attributeName, Attribute.DataType attributeType)
attributeName
- the name of the attributeattributeType
- the JEPC data type of the attributepublic Attribute(Attribute attribute)
attribute
- the attribute to copypublic Attribute()
public Attribute copy()
public java.lang.String getAttributeName()
public void setAttributeName(java.lang.String attributeName)
attributeName
- new name of the attributepublic Attribute.DataType getAttributeType()
public void setAttributeType(Attribute.DataType attributeType)
attributeType
- new data type of the attributepublic java.util.Map<java.lang.String,java.lang.String> getProperties()
public Attribute setMaxStringSize(int maxStringSize)
maxStringSize
- the maximum string size in number of characterspublic int getMaxStringSize()
public Attribute setProducerType(java.lang.String producerType)
producerType
- the type for the schema of this attributepublic Attribute unsetProducerType()
public java.lang.String getProducerType()
public Attribute setMinimumValue(java.lang.Number value)
value
- the minimum allowed value.public java.lang.Number getMinimumValue()
public Attribute setMaximumValue(java.lang.Number value)
value
- the maximum allowed value.public java.lang.Number getMaximumValue()
public void setValueList(java.util.List<java.lang.String> values)
values
- a list containing permitted valuespublic java.util.List<java.lang.String> getValueList()
null
is returned.null
if the
attribute is numeric or no value list was definedpublic java.util.Set<java.lang.String> propertyNames()
public Attribute setProperty(java.lang.String key, java.lang.String value)
key
- the key of the property to setvalue
- the value of the property to setpublic java.lang.String removeProperty(java.lang.String key)
key
- the key of the property to removepublic Attribute setIsKey()
public Attribute unsetIsKey()
public boolean isKey()
public Attribute setIsUnique()
public Attribute unsetIsUnique()
public boolean isUnique()
public boolean isNumeric()
public java.lang.String getProperty(java.lang.String key)
key
- the key of the property to get the value ofpublic Attribute setStaticValue(java.lang.Object value)
value
- the static value of this attributepublic Attribute unsetStaticValue()
public java.lang.String getStaticValue()
public void clearProperties()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void read(java.io.DataInput dataInput) throws java.io.IOException
read
in interface xxl.core.io.Convertable
java.io.IOException
public void write(java.io.DataOutput dataOutput) throws java.io.IOException
write
in interface xxl.core.io.Convertable
java.io.IOException