Package net.sf.gridarta.model.baseobject
Class GameObjectText
- java.lang.Object
-
- net.sf.gridarta.model.baseobject.GameObjectText
-
- All Implemented Interfaces:
java.io.Serializable
public class GameObjectText extends java.lang.Object implements java.io.SerializableA set of key/value attributes.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GameObjectText()Creates a new instance.GameObjectText(@NotNull GameObjectText gameObjectText)Creates a new instance as a copy of another instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddObjectText(@NotNull java.lang.String line, @NotNull AbstractBaseObject<?,?,?,?> baseObject)Appends a line to the object text.booleanequals(@Nullable java.lang.Object obj)@NotNull java.util.Collection<java.lang.String>getAttributeKeys()Returns all attribute keys of this object.@Nullable java.lang.StringgetAttributeValue(@NotNull java.lang.String attributeName)Returns an attribute value by attribute name.@NotNull java.lang.StringgetObjectText()Returns the object text.inthashCode()booleanhasObjectText()Returns whether an object text is set.booleanremoveAttribute(@NotNull java.lang.String attributeName, @NotNull AbstractBaseObject<?,?,?,?> baseObject)Removes an attribute.booleansetAttributeValue(@NotNull java.lang.String attributeName, boolean sameAsInArchetype, @NotNull java.lang.String value, @NotNull AbstractBaseObject<?,?,?,?> baseObject)Updates an attribute's value.booleansetObjectText(@NotNull java.lang.String objectText, @NotNull AbstractBaseObject<?,?,?,?> baseObject)Sets the object text.
-
-
-
Constructor Detail
-
GameObjectText
public GameObjectText()
Creates a new instance.
-
GameObjectText
public GameObjectText(@NotNull @NotNull GameObjectText gameObjectText)Creates a new instance as a copy of another instance.- Parameters:
gameObjectText- the other instance
-
-
Method Detail
-
getAttributeValue
@Nullable public @Nullable java.lang.String getAttributeValue(@NotNull @NotNull java.lang.String attributeName)Returns an attribute value by attribute name.- Parameters:
attributeName- the attribute name- Returns:
- the attribute value or
null
-
getObjectText
@NotNull public @NotNull java.lang.String getObjectText()
Returns the object text.- Returns:
- the object text
-
hasObjectText
public boolean hasObjectText()
Returns whether an object text is set.- Returns:
- whether an object text is set
-
addObjectText
public boolean addObjectText(@NotNull @NotNull java.lang.String line, @NotNull @NotNull AbstractBaseObject<?,?,?,?> baseObject)Appends a line to the object text.- Parameters:
line- the line to append, may contain '\n' for appending multiple linesbaseObject- the game object to notify of changes- Returns:
- whether the object text was changed
-
setObjectText
public boolean setObjectText(@NotNull @NotNull java.lang.String objectText, @NotNull @NotNull AbstractBaseObject<?,?,?,?> baseObject)Sets the object text.- Parameters:
objectText- the object text to setbaseObject- the game object to notify of changes- Returns:
- whether the object text was changed
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(@Nullable @Nullable java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
removeAttribute
public boolean removeAttribute(@NotNull @NotNull java.lang.String attributeName, @NotNull @NotNull AbstractBaseObject<?,?,?,?> baseObject)Removes an attribute.- Parameters:
attributeName- the attribute namebaseObject- the game object to notify of changes- Returns:
- whether the object text has changed
-
setAttributeValue
public boolean setAttributeValue(@NotNull @NotNull java.lang.String attributeName, boolean sameAsInArchetype, @NotNull @NotNull java.lang.String value, @NotNull @NotNull AbstractBaseObject<?,?,?,?> baseObject)Updates an attribute's value.- Parameters:
attributeName- the attribute namesameAsInArchetype- whether the new value is the same as in the archetypevalue- the new valuebaseObject- the game object to notify of changes- Returns:
- whether the object text has changed
-
getAttributeKeys
@NotNull public @NotNull java.util.Collection<java.lang.String> getAttributeKeys()
Returns all attribute keys of this object.- Returns:
- the attribute keys
-
-