Class CustomField



  • public class CustomField
    extends java.lang.Object
    CustomFields model which allows for custom data to be set on a request
    See Also:
    Zendesk Rest API on Requests
    • Constructor Summary

      Constructors 
      Constructor and Description
      CustomField(java.lang.Long id, java.lang.Object value)
      Constructor for a custom field model to be included with a ticket
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      java.lang.Long getId() 
      java.lang.String getValue()
      Deprecated. 
      use #getValueString()

      As of 2.2.2 #value is of type Object, and may be a String, a Boolean, or a List This is to support multi-select custom fields. Use type specific getters for value, or use #getValueObject() to get the value as an object.

      java.lang.Boolean getValueBoolean() 
      java.util.List<java.lang.String> getValueList() 
      java.lang.Object getValueObject() 
      java.lang.String getValueString() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CustomField

        public CustomField(java.lang.Long id,
                           java.lang.Object value)
        Constructor for a custom field model to be included with a ticket
        Parameters:
        id - The id of the custom field
        value - The value of the custom field
    • Method Detail

      • getId

        public java.lang.Long getId()
        Returns:
        the id of the custom ticket field
      • getValue

        @Deprecated
        public java.lang.String getValue()
        Deprecated. use #getValueString()

        As of 2.2.2 #value is of type Object, and may be a String, a Boolean, or a List This is to support multi-select custom fields. Use type specific getters for value, or use #getValueObject() to get the value as an object.

        Returns:
        the value as String of the custom ticket field
      • getValueObject

        public java.lang.Object getValueObject()
        Returns:
        the value as Object of the custom ticket field
      • getValueString

        public java.lang.String getValueString()
        Returns:
        the value as String of the custom ticket field. Returns null if value is not a String
      • getValueBoolean

        public java.lang.Boolean getValueBoolean()
        Returns:
        the value as Boolean of the custom ticket field. Returns null if value is not a Boolean
      • getValueList

        public java.util.List<java.lang.String> getValueList()
        Returns:
        the value of the custom ticket field as a List of String. Returns null if value is not a List