Class TextPartValue

    • Method Detail

      • type

        public final TextPartType type()

        The type of text part. Determines the usage of all other fields and whether or not they're required.

        If the service returns an enum value that is not available in the current SDK version, type will return TextPartType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from typeAsString().

        Returns:
        The type of text part. Determines the usage of all other fields and whether or not they're required.
        See Also:
        TextPartType
      • typeAsString

        public final String typeAsString()

        The type of text part. Determines the usage of all other fields and whether or not they're required.

        If the service returns an enum value that is not available in the current SDK version, type will return TextPartType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from typeAsString().

        Returns:
        The type of text part. Determines the usage of all other fields and whether or not they're required.
        See Also:
        TextPartType
      • displayText

        public final String displayText()

        A short single line description of the link. Must be hyper-linked with the URL itself.

        Used for text parts with the type URL.

        Returns:
        A short single line description of the link. Must be hyper-linked with the URL itself.

        Used for text parts with the type URL.

      • textByLocale

        public final Map<LocaleCode,​String> textByLocale()

        A map of locales to the text in that locale.

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasTextByLocale() method.

        Returns:
        A map of locales to the text in that locale.
      • hasTextByLocale

        public final boolean hasTextByLocale()
        For responses, this returns true if the service returned a value for the TextByLocale property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • textByLocaleAsStrings

        public final Map<String,​String> textByLocaleAsStrings()

        A map of locales to the text in that locale.

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasTextByLocale() method.

        Returns:
        A map of locales to the text in that locale.
      • url

        public final String url()

        The URL itself.

        Returns:
        The URL itself.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)