Package net.oijon.utils.parser.data
Class Tag
- java.lang.Object
-
- net.oijon.utils.parser.data.Tag
-
public class Tag extends java.lang.Object
Stores a tag in a .language file- Author:
- alex
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getName()
Gets the name of the tagboolean
isEqual(Tag tag)
Deprecated.as of v1.2.0, as this should have been handled via equals() instead.boolean
isSameTag(Tag tag)
Checks if two tags share the same name.void
set(java.lang.String data)
Sets the data of a tagprotected void
setName(java.lang.String name)
Sets the name of the tag.java.lang.String
toString()
Converts a tag to a stringjava.lang.String
value()
Gets the data of a tag
-
-
-
Constructor Detail
-
Tag
public Tag(java.lang.String name, java.lang.String data)
Creates a tag- Parameters:
name
- The name of the tag (First part before the :)data
- The data the tag contains (Second part after the :)
-
Tag
public Tag(java.lang.String tag)
Creates a tag- Parameters:
tag
- The tag in string format (name:data)
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of the tag- Returns:
- The name of the tag
-
setName
protected void setName(java.lang.String name)
Sets the name of the tag.- Parameters:
name
- The new name
-
value
public java.lang.String value()
Gets the data of a tag- Returns:
- The data of a tag
-
set
public void set(java.lang.String data)
Sets the data of a tag- Parameters:
data
- The new data for the tag
-
toString
public java.lang.String toString()
Converts a tag to a string- Overrides:
toString
in classjava.lang.Object
-
isSameTag
public boolean isSameTag(Tag tag)
Checks if two tags share the same name.- Parameters:
tag
- The tag to be checked against- Returns:
- true if the names are the same, false otherwise
-
isEqual
@Deprecated public boolean isEqual(Tag tag)
Deprecated.as of v1.2.0, as this should have been handled via equals() instead.Checks if two tags are equal- Parameters:
tag
- The tag to check- Returns:
- true if equal, false otherwise
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-