Record Class DefaultResponse

java.lang.Object
java.lang.Record
org.apereo.cas.authentication.principal.DefaultResponse
All Implemented Interfaces:
Serializable, org.apereo.cas.authentication.principal.Response

public record DefaultResponse(org.apereo.cas.authentication.principal.Response.ResponseType responseType, String url, Map<String,String> attributes) extends Record implements org.apereo.cas.authentication.principal.Response
Encapsulates a Response to send back for a particular service.
Since:
3.1
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apereo.cas.authentication.principal.Response

    org.apereo.cas.authentication.principal.Response.ResponseType
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultResponse(org.apereo.cas.authentication.principal.Response.ResponseType responseType, String url, Map<String,String> attributes)
    Creates an instance of a DefaultResponse record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the attributes record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    static org.apereo.cas.authentication.principal.Response
    Gets header response.
    static org.apereo.cas.authentication.principal.Response
    getPostResponse(String url, Map<String,String> attributes)
    Gets the post response.
    static org.apereo.cas.authentication.principal.Response
    Gets the redirect response.
    final int
    Returns a hash code value for this object.
    org.apereo.cas.authentication.principal.Response.ResponseType
    Returns the value of the responseType record component.
    final String
    Returns a string representation of this record class.
    url()
    Returns the value of the url record component.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DefaultResponse

      public DefaultResponse(org.apereo.cas.authentication.principal.Response.ResponseType responseType, String url, Map<String,String> attributes)
      Creates an instance of a DefaultResponse record class.
      Parameters:
      responseType - the value for the responseType record component
      url - the value for the url record component
      attributes - the value for the attributes record component
  • Method Details

    • getPostResponse

      public static org.apereo.cas.authentication.principal.Response getPostResponse(String url, Map<String,String> attributes)
      Gets the post response.
      Parameters:
      url - the url
      attributes - the attributes
      Returns:
      the post response
    • getHeaderResponse

      public static org.apereo.cas.authentication.principal.Response getHeaderResponse(String url, Map<String,String> attributes)
      Gets header response.
      Parameters:
      url - the url
      attributes - the attributes
      Returns:
      the header response
    • getRedirectResponse

      public static org.apereo.cas.authentication.principal.Response getRedirectResponse(String url, Map<String,String> parameters)
      Gets the redirect response.
      Parameters:
      url - the url
      parameters - the parameters
      Returns:
      the redirect response
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • responseType

      public org.apereo.cas.authentication.principal.Response.ResponseType responseType()
      Returns the value of the responseType record component.
      Specified by:
      responseType in interface org.apereo.cas.authentication.principal.Response
      Returns:
      the value of the responseType record component
    • url

      public String url()
      Returns the value of the url record component.
      Specified by:
      url in interface org.apereo.cas.authentication.principal.Response
      Returns:
      the value of the url record component
    • attributes

      public Map<String,String> attributes()
      Returns the value of the attributes record component.
      Specified by:
      attributes in interface org.apereo.cas.authentication.principal.Response
      Returns:
      the value of the attributes record component