com.google.template.soy.data
Class SanitizedContent

java.lang.Object
  extended by com.google.template.soy.data.SoyData
      extended by com.google.template.soy.data.SanitizedContent

@ParametersAreNonnullByDefault
@Immutable
public final class SanitizedContent
extends SoyData

A chunk of sanitized content of a known kind, e.g. the output of an HTML sanitizer.


Nested Class Summary
static class SanitizedContent.ContentKind
          A kind of textual content.
 
Method Summary
 boolean equals(Object other)
          Compares this data object against another for equality in the sense of the operator '==' for Soy expressions.
 String getContent()
          Returns a string of valid content with kind getContentKind().
 SanitizedContent.ContentKind getContentKind()
          Returns the kind of content.
 int hashCode()
           
 boolean toBoolean()
          Converts this data object into a boolean (e.g.
 String toString()
          Converts this data object into a string (e.g.
 
Methods inherited from class com.google.template.soy.data.SoyData
booleanValue, createFromExistingData, createFromExistingData, floatValue, integerValue, numberValue, stringValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getContent

public String getContent()
Returns a string of valid content with kind getContentKind().


getContentKind

public SanitizedContent.ContentKind getContentKind()
Returns the kind of content.


toBoolean

public boolean toBoolean()
Description copied from class: SoyData
Converts this data object into a boolean (e.g. when used in a boolean context). In other words, this method tells whether this object is truthy.

Specified by:
toBoolean in class SoyData
Returns:
The value of this data object if coerced into a boolean. I.e. true if this object is truthy, false if this object is falsy.

toString

public String toString()
Description copied from class: SoyData
Converts this data object into a string (e.g. when used in a string context).

Specified by:
toString in class SoyData
Returns:
The value of this data object if coerced into a string.

equals

public boolean equals(@Nullable
                      Object other)
Description copied from class: SoyData
Compares this data object against another for equality in the sense of the operator '==' for Soy expressions.

Specified by:
equals in class SoyData
Parameters:
other - The other data object to compare against.
Returns:
True if the two objects are equal.

hashCode

public int hashCode()
Overrides:
hashCode in class Object