Package com.logicaldoc.core.metadata

# Class Attribute

java.lang.Object
com.logicaldoc.core.metadata.Attribute

All Implemented Interfaces:
  `Serializable`, `Comparable<Attribute>`

@Embeddable public class Attribute extends Object implements Comparable<Attribute>, Serializable
This class defines the value of an attribute associated to an extensible object. For each value, is possible to define the type and if it is mandatory or not.

Since:
  4.5.1
Author:
  Matteo Caruso - LogicalDOC
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`EDITOR_DEFAULT`
`static final int`
`EDITOR_LISTBOX`
`static final int`
`TYPE_BOOLEAN`
`static final int`
`TYPE_DATE`
`static final int`
`TYPE_DOCUMENT`
`static final int`
`TYPE_DOUBLE`
`static final int`
`TYPE_FOLDER`
`static final int`
`TYPE_INT`
`static final int`
`TYPE_SECTION`
`static final int`
`TYPE_STRING`
`static final int`
`TYPE_USER`

## Constructor Summary

Constructors
Constructor
Description
`Attribute()`
`Attribute(Attribute source)`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(Attribute o)`
`boolean`
`equals(Object obj)`
`Boolean`
`getBooleanValue()`
`Date`
`getDateValue()`
`String`
`getDependsOn()`
`Object`
`getDisplayValue()`
Gets the value as it should be displayed to the user
`Double`
`getDoubleValue()`
`int`
`getEditor()`
`String`
`getInitialization()`
`Long`
`getIntValue()`
`String`
`getLabel()`
`String`
`getName()`
`String`
`getParent()`
`int`
`getPosition()`
This is the position of the attribute into the attributes list
`Long`
`getSetId()`
`String`
`getStringValue()`
`String`
`getStringValues()`
`int`
`getType()`
`String`
`getValidation()`
`Object`
`getValue()`
Gets the attribute value.
`int`
`hashCode()`
`boolean`
`isHidden()`
`boolean`
`isMandatory()`
Whether an attribute value is mandatory or not.
`boolean`
`isMultiple()`
`boolean`
`isReadonly()`
`boolean`
`isSection()`
`void`
`setBooleanValue(Boolean booleanValue)`
`void`
`setDateValue(Date dateValue)`
`void`
`setDependsOn(String dependsOn)`
`void`
`setDoubleValue(Double doubleValue)`
`void`
`setEditor(int editor)`
`void`
`setHidden(boolean hidden)`
`void`
`setInitialization(String initialization)`
`void`
`setIntValue(Long intValue)`
`void`
`setLabel(String label)`
`void`
`setMandatory(boolean mandatory)`
`void`
`setMultiple(boolean multiple)`
`void`
`setName(String name)`
`void`
`setParent(String parent)`
`void`
`setPosition(int position)`
`void`
`setReadonly(boolean readonly)`
`void`
`setSetId(Long setId)`
`void`
`setStringValue(String stringValue)`
`void`
`setStringValues(String stringValues)`
`void`
`setType(int type)`
`void`
`setValidation(String validation)`
`void`
`setValue(Object value)`
Sets the attribute value.

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### TYPE_STRING

public static final int TYPE_STRING

See Also:
  - Constant Field Values

### TYPE_INT

public static final int TYPE_INT

See Also:
  - Constant Field Values

### TYPE_DOUBLE

public static final int TYPE_DOUBLE

See Also:
  - Constant Field Values

### TYPE_DATE

public static final int TYPE_DATE

See Also:
  - Constant Field Values

### TYPE_USER

public static final int TYPE_USER

See Also:
  - Constant Field Values

### TYPE_BOOLEAN

public static final int TYPE_BOOLEAN

See Also:
  - Constant Field Values

### TYPE_FOLDER

public static final int TYPE_FOLDER

See Also:
  - Constant Field Values

### TYPE_DOCUMENT

public static final int TYPE_DOCUMENT

See Also:
  - Constant Field Values

### TYPE_SECTION

public static final int TYPE_SECTION

See Also:
  - Constant Field Values

### EDITOR_DEFAULT

public static final int EDITOR_DEFAULT

See Also:
  - Constant Field Values

### EDITOR_LISTBOX

public static final int EDITOR_LISTBOX

See Also:
  - Constant Field Values

## Constructor Details

### Attribute

public Attribute()

### Attribute

public Attribute(Attribute source)

## Method Details

### getStringValue

public String getStringValue()

### setStringValue

public void setStringValue(String stringValue)

### getIntValue

public Long getIntValue()

### setIntValue

public void setIntValue(Long intValue)

### getDoubleValue

public Double getDoubleValue()

### setDoubleValue

public void setDoubleValue(Double doubleValue)

### getDateValue

public Date getDateValue()

### setDateValue

public void setDateValue(Date dateValue)

### getBooleanValue

@Nullable public Boolean getBooleanValue()

### setBooleanValue

public void setBooleanValue(Boolean booleanValue)

### getType

public int getType()

### setType

public void setType(int type)

### isSection

public boolean isSection()

### getValue

public Object getValue()
Gets the attribute value. It can be as String, Long, Double or Date.

Returns:
  The attribute value as Object.

### getDisplayValue

public Object getDisplayValue()
Gets the value as it should be displayed to the user

Returns:
  The attribute value to display

### setValue

public void setValue(Object value)
Sets the attribute value. It can be as String, Long, Double or Date.

Parameters:
  `value` - The attribute value.

### isMandatory

public boolean isMandatory()
Whether an attribute value is mandatory or not.

Returns:
  If false, the attribute value is not mandatory; if true, the attribute value is mandatory.

### setMandatory

public void setMandatory(boolean mandatory)

### getPosition

public int getPosition()
This is the position of the attribute into the attributes list

Returns:
  the attribute's position

### setPosition

public void setPosition(int position)

### compareTo

public int compareTo(Attribute o)

Specified by:
  `compareTo` in interface `Comparable<Attribute>`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### getLabel

public String getLabel()

### setLabel

public void setLabel(String label)

### getEditor

public int getEditor()

### setEditor

public void setEditor(int editor)

### getSetId

public Long getSetId()

### setSetId

public void setSetId(Long setId)

### getParent

public String getParent()

### setParent

public void setParent(String parent)

### getName

public String getName()

### setName

public void setName(String name)

### getStringValues

public String getStringValues()

### setStringValues

public void setStringValues(String stringValues)

### getDependsOn

public String getDependsOn()

### setDependsOn

public void setDependsOn(String dependsOn)

### getValidation

public String getValidation()

### setValidation

public void setValidation(String validation)

### getInitialization

public String getInitialization()

### setInitialization

public void setInitialization(String initialization)

### isHidden

public boolean isHidden()

### setHidden

public void setHidden(boolean hidden)

### isReadonly

public boolean isReadonly()

### setReadonly

public void setReadonly(boolean readonly)

### isMultiple

public boolean isMultiple()

### setMultiple

public void setMultiple(boolean multiple)