Class RepresentationContract


  • public final class RepresentationContract
    extends Object
    Operation request/response representation details.
    • Constructor Detail

      • RepresentationContract

        public RepresentationContract()
    • Method Detail

      • contentType

        public String contentType()
        Get the contentType property: Specifies a registered or custom content type for this representation, e.g. application/xml.
        Returns:
        the contentType value.
      • withContentType

        public RepresentationContract withContentType​(String contentType)
        Set the contentType property: Specifies a registered or custom content type for this representation, e.g. application/xml.
        Parameters:
        contentType - the contentType value to set.
        Returns:
        the RepresentationContract object itself.
      • schemaId

        public String schemaId()
        Get the schemaId property: Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
        Returns:
        the schemaId value.
      • withSchemaId

        public RepresentationContract withSchemaId​(String schemaId)
        Set the schemaId property: Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
        Parameters:
        schemaId - the schemaId value to set.
        Returns:
        the RepresentationContract object itself.
      • typeName

        public String typeName()
        Get the typeName property: Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
        Returns:
        the typeName value.
      • withTypeName

        public RepresentationContract withTypeName​(String typeName)
        Set the typeName property: Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
        Parameters:
        typeName - the typeName value to set.
        Returns:
        the RepresentationContract object itself.
      • formParameters

        public List<ParameterContract> formParameters()
        Get the formParameters property: Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
        Returns:
        the formParameters value.
      • withFormParameters

        public RepresentationContract withFormParameters​(List<ParameterContract> formParameters)
        Set the formParameters property: Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
        Parameters:
        formParameters - the formParameters value to set.
        Returns:
        the RepresentationContract object itself.
      • examples

        public Map<String,​ParameterExampleContract> examples()
        Get the examples property: Exampled defined for the representation.
        Returns:
        the examples value.
      • withExamples

        public RepresentationContract withExamples​(Map<String,​ParameterExampleContract> examples)
        Set the examples property: Exampled defined for the representation.
        Parameters:
        examples - the examples value to set.
        Returns:
        the RepresentationContract object itself.
      • validate

        public void validate()
        Validates the instance.
        Throws:
        IllegalArgumentException - thrown if the instance is not valid.