Package com.crawljax.core.state
Class Element
- java.lang.Object
-
- com.crawljax.core.state.Element
-
- All Implemented Interfaces:
Serializable
@Immutable public class Element extends Object implements Serializable
This class represents an element. It is built from the node name and node text contents.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableMap<String,String>attributesprivate Nodenodeprivate static longserialVersionUIDprivate Stringtagprivate Stringtext
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequalAttributes(Element otherElement)Are all the attributes the same?booleanequalId(Element otherElement)Are both Id's the same?booleanequals(Object object)booleanequalText(Element otherElement)Are both the text equal?StringgetAttributeOrNull(String attribute)com.google.common.collect.ImmutableMap<String,String>getAttributes()StringgetElementId()Search for the attribute "id" and return the value.NodegetNode()StringgetTag()StringgetText()inthashCode()StringtoString()
-
-
-
Method Detail
-
equalAttributes
public boolean equalAttributes(Element otherElement)
Are all the attributes the same?- Parameters:
otherElement- the other element to compare- Returns:
- true if the other attributes are equal to this one.
-
equalId
public boolean equalId(Element otherElement)
Are both Id's the same?- Parameters:
otherElement- the other element to compare- Returns:
- true if id == otherElement.id
-
equalText
public boolean equalText(Element otherElement)
Are both the text equal?- Parameters:
otherElement- the other element to compare- Returns:
- true if the text of both elements is the same
-
getElementId
public String getElementId()
Search for the attribute "id" and return the value.- Returns:
- the id of this element or null when not found
-
getTag
public String getTag()
- Returns:
- the tag
-
getText
public String getText()
- Returns:
- the text
-
getAttributeOrNull
public String getAttributeOrNull(String attribute)
- Parameters:
attribute- the attribute name.- Returns:
- the attribute by its name or
nullif the attribute cannot be found.
-
getNode
public Node getNode()
- Returns:
- The node.
-
-