Package com.google.gwt.safecss.shared
Class SafeStylesString
- java.lang.Object
-
- com.google.gwt.safecss.shared.SafeStylesString
-
- All Implemented Interfaces:
SafeStyles
,java.io.Serializable
class SafeStylesString extends java.lang.Object implements SafeStyles
A string wrapped as an object of typeSafeStyles
.This class is package-private and intended for internal use by the
com.google.gwt.safecss
package.All implementors must implement .equals and .hashCode so that they operate just like String.equals() and String.hashCode().
-
-
Constructor Summary
Constructors Constructor Description SafeStylesString(java.lang.String css)
Constructs aSafeStylesString
from a string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString()
Returns this object's contained CSS as a string.boolean
equals(java.lang.Object obj)
Compares this string to the specified object.int
hashCode()
Returns a hash code for this string.
-
-
-
Constructor Detail
-
SafeStylesString
SafeStylesString(java.lang.String css)
Constructs aSafeStylesString
from a string. Callers are responsible for ensuring that the string passed as the argument to this constructor satisfies the constraints of the contract imposed by theSafeStyles
interface.- Parameters:
css
- the string to be wrapped as aSafeStyles
-
-
Method Detail
-
asString
public java.lang.String asString()
Returns this object's contained CSS as a string.Based on this class' contract, the returned value will be non-null and a string that is safe to use in an CSS attribute context.
- Specified by:
asString
in interfaceSafeStyles
- Returns:
- the contents as a String
-
equals
public boolean equals(java.lang.Object obj)
Compares this string to the specified object.- Specified by:
equals
in interfaceSafeStyles
- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object to compare to
-
hashCode
public int hashCode()
Returns a hash code for this string.- Specified by:
hashCode
in interfaceSafeStyles
- Overrides:
hashCode
in classjava.lang.Object
-
-