public class Attribute extends Object implements Identifiable, Comparable<Attribute>
Constructor and Description |
---|
Attribute(String name)
Constructor.
|
Attribute(String name,
boolean required,
boolean immutable)
Constructor.
|
Attribute(String name,
boolean required,
boolean immutable,
String type,
String pattern,
String defaultValue,
String description)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Attribute a)
Comapres two attributes lexicographically based on their identifier.
|
boolean |
equals(Object obj) |
String |
getDefaultValue()
Returns attribute's default value.
|
String |
getDescription()
Returns attribute's description.
|
String |
getIdentifier()
Returns attribute's identifier.
|
String |
getName()
Returns attribute's name.
|
String |
getPattern()
Returns attribute's pattern.
|
String |
getType()
Returns attribute's type.
|
int |
hashCode() |
boolean |
isImmutable()
Returns whether atttribute is immutable.
|
boolean |
isRequired()
Returns whether atttribute is required.
|
void |
setDefaultValue(String defaultValue)
Sets attribute's default value.
|
void |
setDescription(String description)
Sets attribute's description.
|
void |
setImmutable(boolean immutable)
Sets attribute's immutability.
|
void |
setName(String name)
Sets attribute's name.
|
void |
setPattern(String pattern)
Sets attribute's pattern.
|
void |
setRequired(boolean required)
Sets attribute's requiredness.
|
void |
setType(String type)
Sets attribute's type.
|
String |
toString()
Resturns string representation of the attribute
|
String |
toText()
Returns plain text representation of the attribute according to OCCI
standard.
|
public Attribute(String name, boolean required, boolean immutable, String type, String pattern, String defaultValue, String description)
name
- name of the attribute. Cannot be null nor empty.required
- whether attribute is required or notimmutable
- whether attribute is immutable or nottype
- attribute's typepattern
- attribute's patterndefaultValue
- attribute's default valuedescription
- attribute's descriptionpublic Attribute(String name, boolean required, boolean immutable)
name
- name of the attribute. Cannot be null nor empty.required
- whether attribute is required or notimmutable
- whether attribute is immutable or notpublic Attribute(String name)
name
- name of the attribute. Cannot be null nor empty.public String getName()
public void setName(String name)
name
- attribute's name. Cannot be null nor emptypublic String getIdentifier()
getIdentifier
in interface Identifiable
public boolean isRequired()
public void setRequired(boolean required)
required
- whether the attribute should be required or notpublic boolean isImmutable()
public void setImmutable(boolean immutable)
immutable
- whether the attribute should be immutable or notpublic String getType()
public void setType(String type)
type
- attribute's typepublic String getPattern()
public void setPattern(String pattern)
pattern
- attribute's patternpublic String getDefaultValue()
public void setDefaultValue(String defaultValue)
defaultValue
- attribute's default valuepublic String getDescription()
public void setDescription(String description)
description
- attribute's descriptionpublic int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
obj
- object to compare attribute withObject.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
public String toText()
public int compareTo(Attribute a)
compareTo
in interface Comparable<Attribute>
Comparable.compareTo(java.lang.Object)
Copyright © 2016. All Rights Reserved.