public class Category extends Object implements Identifiable, Comparable<Category>
Modifier and Type | Field and Description |
---|---|
static URI |
SCHEME_CORE_DEFAULT |
static URI |
SCHEME_INFRASTRUCTURE_DEFAULT |
Constructor and Description |
---|
Category(URI scheme,
String term)
Constructor.
|
Category(URI scheme,
String term,
String title,
URI location,
Collection<Attribute> attributes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAction(Action action)
Adds given action to category.
|
boolean |
addAttribute(Attribute attribute)
Adds given attribute to category.
|
boolean |
addEntity(Entity entity)
Adds given entity to category.
|
void |
clearActions()
Removes all actions from category.
|
void |
clearAttributes()
Removes all attributes from category.
|
void |
clearEntities()
Removes all entities from category.
|
int |
compareTo(Category c)
Comapres two cetegories lexicographically based on their identifier.
|
boolean |
containsAction(Action action)
Checks whether category has given action.
|
boolean |
containsAction(String actionIdentifier)
Checks whether category has given action.
|
boolean |
containsAttribute(Attribute attribute)
Checks whether category has given attribute.
|
boolean |
containsAttribute(String attributeIdentifier)
Checks whether category has given attribute.
|
boolean |
containsEntity(Entity entity)
Checks whether category has given entity.
|
boolean |
containsEntity(String entityIdentifier)
Checks whether category has given entity.
|
boolean |
equals(Object obj) |
Action |
getAction(String actionIdentifier)
Returns action from category.
|
Set<Action> |
getActions()
Returns all category's actions in form of set.
|
Attribute |
getAttribute(String attributeIdentifier)
Returns attribute from category.
|
Set<Attribute> |
getAttributes()
Returns all category's attributes in form of set.
|
Set<Entity> |
getEntities()
Returns all category's entities in form of set.
|
Entity |
getEntity(String entityIdentifier)
Returns entity from category.
|
String |
getIdentifier()
Returns category's identifier.
|
URI |
getLocation()
Returns category's location.
|
URI |
getScheme()
Returns category's scheme.
|
String |
getTerm()
Returns category's term.
|
String |
getTitle()
Returns category's title.
|
int |
hashCode() |
boolean |
removeAction(Action action)
Removes action from category
|
boolean |
removeAttribute(Attribute attribute)
Removes attribute from category
|
boolean |
removeEntity(Entity entity)
Removes entity from category
|
void |
setLocation(URI location)
Sets category's location
|
void |
setScheme(URI scheme)
Sets category's scheme.
|
void |
setTerm(String term)
Sets category's term.
|
void |
setTitle(String title)
Sets category's title
|
com.sun.net.httpserver.Headers |
toHeaders()
Returns an occi text representation of category and its subtypes (kinds
and mixins) according to OCCI standard in form of headers.
|
com.sun.net.httpserver.Headers |
toHeaders(boolean fullRendering)
Returns an occi text representation of category and its subtypes (kinds
and mixins) according to OCCI standard in form of headers.
|
String |
toString()
Resturns string representation of the category
|
String |
toText()
Returns a plain text representation of category and its subtypes (kinds
and mixins) according to OCCI standard.
|
String |
toText(boolean fullRendering)
Returns a plain text representation of category and its subtypes (kinds
and mixins) according to OCCI standard.
|
public static final URI SCHEME_CORE_DEFAULT
public static final URI SCHEME_INFRASTRUCTURE_DEFAULT
public Category(URI scheme, String term, String title, URI location, Collection<Attribute> attributes)
scheme
- category's scheme. Cannot be null.term
- category's term. Cannot be null nor empty.title
- category's titlelocation
- category's locationattributes
- category's attributespublic String getTerm()
public void setTerm(String term)
term
- category's term. Cannot be null nor empty.public URI getScheme()
public void setScheme(URI scheme)
scheme
- category's scheme. Cannot be null.public String getIdentifier()
getIdentifier
in interface Identifiable
public String getTitle()
public void setTitle(String title)
title
- category's titlepublic URI getLocation()
public void setLocation(URI location)
location
- category's locationpublic boolean containsAttribute(Attribute attribute)
attribute
- attribute to be looked uppublic boolean containsAttribute(String attributeIdentifier)
attributeIdentifier
- identifier of attribute to be looked uppublic boolean addAttribute(Attribute attribute)
attribute
- attribute to be addedpublic Attribute getAttribute(String attributeIdentifier)
attributeIdentifier
- identifier of the requested attributepublic boolean removeAttribute(Attribute attribute)
attribute
- to be removedpublic void clearAttributes()
public Set<Attribute> getAttributes()
public boolean containsAction(Action action)
action
- action to be looked uppublic boolean containsAction(String actionIdentifier)
actionIdentifier
- identifier of action to be looked uppublic boolean addAction(Action action)
action
- action to be addedpublic Action getAction(String actionIdentifier)
actionIdentifier
- identifier of the requested actionpublic boolean removeAction(Action action)
action
- to be removedpublic void clearActions()
public Set<Action> getActions()
public boolean containsEntity(Entity entity)
entity
- entity to be looked uppublic boolean containsEntity(String entityIdentifier)
entityIdentifier
- identifier of entity to be looked uppublic boolean addEntity(Entity entity)
entity
- entity to be addedpublic Entity getEntity(String entityIdentifier)
entityIdentifier
- identifier of the requested entitypublic boolean removeEntity(Entity entity)
entity
- to be removedpublic void clearEntities()
public Set<Entity> getEntities()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
obj
- object to compare category withObject.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
public String toText()
public String toText(boolean fullRendering)
fullRendering
- whether to render all the informationpublic com.sun.net.httpserver.Headers toHeaders()
public com.sun.net.httpserver.Headers toHeaders(boolean fullRendering)
fullRendering
- whether to render all the informationpublic int compareTo(Category c)
compareTo
in interface Comparable<Category>
Comparable.compareTo(java.lang.Object)
Copyright © 2016. All Rights Reserved.