twitter4j
Class Annotation

java.lang.Object
  extended by twitter4j.Annotation
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Annotation>

public class Annotation
extends java.lang.Object
implements java.lang.Comparable<Annotation>, java.io.Serializable

A data class representing an Annotation of a Status or a Tweet

Since:
Twitter4J 2.1.4
Author:
Roy Reshef - royreshef at gmail.com
See Also:
Annotations Overview | dev.twitter.com, Serialized Form

Constructor Summary
Annotation(java.lang.String type)
          Construct an Annotation with a type but no attributes
Annotation(java.lang.String type, java.util.Map<java.lang.String,java.lang.String> attributes)
          Construct an Annotation with a type and attributes
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Adds a single attribute
 Annotation attribute(java.lang.String name, java.lang.String value)
          Adds a single attribute
 Annotation attributes(java.util.Map<java.lang.String,java.lang.String> attributes)
          Sets the attributes Ensures the class's property is not null
 int compareTo(Annotation other)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
           
 java.lang.String getType()
           
 int hashCode()
           
 boolean isEmpty()
           
 void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
          Sets the attributes Ensures the class's property is not null
 void setType(java.lang.String type)
          Sets the type Ensures the class's property is not null
 java.lang.Integer size()
           
 java.lang.String toString()
           
 Annotation type(java.lang.String type)
          Sets the type Ensures the class's property is not null
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Annotation

public Annotation(java.lang.String type)
Construct an Annotation with a type but no attributes

Parameters:
type - - the type

Annotation

public Annotation(java.lang.String type,
                  java.util.Map<java.lang.String,java.lang.String> attributes)
Construct an Annotation with a type and attributes

Parameters:
type -
attributes -
Method Detail

getType

public java.lang.String getType()
Returns:
the type

setType

public void setType(java.lang.String type)
Sets the type Ensures the class's property is not null

Parameters:
type - - the type

type

public Annotation type(java.lang.String type)
Sets the type Ensures the class's property is not null

Parameters:
type - - the type
Returns:
this (for coding convenience)

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Returns:
the attributes

setAttributes

public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the attributes Ensures the class's property is not null

Parameters:
attributes - - the attributes

attributes

public Annotation attributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the attributes Ensures the class's property is not null

Parameters:
attributes - - the attributes
Returns:
this (for coding convenience)

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Adds a single attribute

Parameters:
name - - the attribute name
value - - the attribute value

attribute

public Annotation attribute(java.lang.String name,
                            java.lang.String value)
Adds a single attribute

Parameters:
name - - the attribute name
value - - the attribute value
Returns:
this (for coding convenience)

isEmpty

public boolean isEmpty()
Returns:
true if the attributes are empty, false otherwise

size

public java.lang.Integer size()
Returns:
true the number of attributes

compareTo

public int compareTo(Annotation other)
Specified by:
compareTo in interface java.lang.Comparable<Annotation>

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.