org.geebis.books.model.label
Class Label

java.lang.Object
  extended by org.geebis.books.model.label.Label
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AccountLabel, AccountUsageLabel, CustomerLabel, EmployeeLabel, GenericLabel, ItemLabel, JobLabel, ManufacturerLabel, TrackableLabel, VendorLabel

@Name(value="label")
public abstract class Label
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
  Label()
           
protected Label(java.lang.String name)
           
 
Method Summary
static void addLabel(Labelable labelable, Label label)
          Adds a label to a labelable object.
 java.lang.Long getId()
           
 java.lang.String getName()
           
 java.lang.Integer getVersion()
           
static boolean isLabelCompatible(Labelable labelable, Label label)
          Determines if the label can be added to the labelable object
static void removeLabel(Labelable labelable, Label label)
          Removes the label from the labelable object
 void setId(java.lang.Long id)
           
 void setName(java.lang.String name)
           
 void setVersion(java.lang.Integer version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Label

public Label()

Label

protected Label(java.lang.String name)
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getVersion

public java.lang.Integer getVersion()

setVersion

public void setVersion(java.lang.Integer version)

getId

public java.lang.Long getId()

setId

public void setId(java.lang.Long id)

addLabel

public static void addLabel(Labelable labelable,
                            Label label)
                     throws IncompatibleLabelException
Adds a label to a labelable object.

Parameters:
labelable - the object to add the label to
label - the label to add
Throws:
IncompatibleLabelException - if the label isn't compatible with the labelable object

removeLabel

public static void removeLabel(Labelable labelable,
                               Label label)
Removes the label from the labelable object

Parameters:
labelable - the object to remove the label from
label - the label to remove

isLabelCompatible

public static boolean isLabelCompatible(Labelable labelable,
                                        Label label)
Determines if the label can be added to the labelable object

Parameters:
labelable - the object that the label is tested against
label - the label that the user is trying to apply
Returns:
true if the label can be applied to labelable, false if otherwise