Package net.sf.okapi.lib.xliff2.core
Class Note
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.core.DataWithExtAttributes
-
- net.sf.okapi.lib.xliff2.core.Note
-
- All Implemented Interfaces:
IWithExtAttributes
public class Note extends DataWithExtAttributes
Represents a note object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNote.AppliesToTypes of object a note can apply to.
-
Constructor Summary
Constructors Constructor Description Note()Creates a new emptyNoteobject.Note(String content)Creates a newNoteobject with a content with a scope set toNote.AppliesTo.UNDEFINED.Note(String content, Note.AppliesTo appliesTo)Creates a newNoteobject with a content and a scope.Note(Note original)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Indicates if this object is equals to a given one.Note.AppliesTogetAppliesTo()Gets the type of object this note applies to.StringgetCategory()Gets the category for this note.StringgetId()Gets the id for this note.intgetPriority()Gets the priority for this note.StringgetText()Gets the text content of this note.inthashCode()booleanisEmpty()Indicates if this note is empty, that is if the content is null or empty.voidsetAppliesTo(Note.AppliesTo appliesTo)Sets the type of object this note applies to.voidsetCategory(String category)Sets the category for this note.voidsetId(String id)Sets the id for this note.voidsetPriority(int priority)Sets the priority for this note.voidsetText(String content)Sets the content of this note.StringtoString()Gets a representation for this note: its content.-
Methods inherited from class net.sf.okapi.lib.xliff2.core.DataWithExtAttributes
getExtAttributes, getExtAttributeValue, hasExtAttribute, setExtAttributes
-
-
-
-
Constructor Detail
-
Note
public Note()
Creates a new emptyNoteobject.
-
Note
public Note(Note original)
Copy constructor.- Parameters:
original- the original object to duplicate.
-
Note
public Note(String content)
Creates a newNoteobject with a content with a scope set toNote.AppliesTo.UNDEFINED.- Parameters:
content- the content of the note.
-
Note
public Note(String content, Note.AppliesTo appliesTo)
Creates a newNoteobject with a content and a scope.- Parameters:
content- the content of this note.appliesTo- the scope of this note.
-
-
Method Detail
-
toString
public String toString()
Gets a representation for this note: its content.
-
getText
public String getText()
Gets the text content of this note.- Returns:
- the text content of this note.
-
setText
public void setText(String content)
Sets the content of this note.- Parameters:
content- the new content to set.
-
isEmpty
public boolean isEmpty()
Indicates if this note is empty, that is if the content is null or empty.- Returns:
- true if the content is null or empty.
-
getAppliesTo
public Note.AppliesTo getAppliesTo()
Gets the type of object this note applies to.- Returns:
- the type of object this note applies to.
-
setAppliesTo
public void setAppliesTo(Note.AppliesTo appliesTo)
Sets the type of object this note applies to.- Parameters:
appliesTo- the type of object this note applies to.
-
getId
public String getId()
Gets the id for this note.- Returns:
- the id of this note (can be null).
-
setId
public void setId(String id)
Sets the id for this note.- Parameters:
id- the new id to set.
-
getCategory
public String getCategory()
Gets the category for this note.- Returns:
- the category for this note (can be null).
-
setCategory
public void setCategory(String category)
Sets the category for this note.- Parameters:
category- the new category to set (can be null).
-
getPriority
public int getPriority()
Gets the priority for this note.- Returns:
- the priority for this note. 1 indicates the highest priority, 10 the lowest.
-
setPriority
public void setPriority(int priority)
Sets the priority for this note.- Parameters:
priority- the new priority to set. The value must be between 1 (inclusive) and 10 (inclusive). 1 indicates the highest priority, 10 the lowest.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDataWithExtAttributes
-
equals
public boolean equals(Object obj)
Description copied from class:DataWithExtAttributesIndicates if this object is equals to a given one.- Overrides:
equalsin classDataWithExtAttributes- Parameters:
obj- the other object to compare.- Returns:
- true if the two objects are identical.
-
-