Package com.postman.collection
Class Property
java.lang.Object
com.postman.collection.CollectionElement
com.postman.collection.Property
Postman SDK analog: Not directly related, but probably close to
PropertyBase
Utility class to store key-value pairs with additional, optional description
and type
properties
-
Constructor Summary
ConstructorDescriptionConstructs a Property with with justkey
andvalue
propertiesConstructs a Property with the specified properties.Constructs a Property with all specified properties. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns thedescription
property, or null if it is not setgetKey()
returns the value of thekey
propertygetToken()
Returns the Postman token for a variable, eg.getType()
Returns thetype
property for this variablegetValue()
Sets thevalue
property for this propertyvoid
setDescription
(String desc) Sets thedescription
propertyvoid
Sets thekey
value for this propertyvoid
Sets thetype
property for this variablevoid
Sets thevalue
property for this variableMethods inherited from class com.postman.collection.CollectionElement
getCollection, getDefaultCollectionSchema, getDefaultValidationSchema, getParent, getUUID, getValidationMessages, isEquivalentTo, setParent, setUUID, toJson, toJson, validate, validate
-
Constructor Details
-
Property
Constructs a Property with the specified properties. Thetype
property is set tonull
- Parameters:
key
- Value for thekey
property. NOTE: If a null key is provided it will be transformed to an empty string ("");value
- Value for thevalue
propertydescription
- Value for thedescription
proptery
-
Property
Constructs a Property with all specified properties.- Parameters:
key
- Value for thekey
property. NOTE: If a null key is provided it will be transformed to an empty string ("");value
- Value for thevalue
propertydescription
- Value for thedescription
propertytype
- Value for thetype
property
-
Property
Constructs a Property with with justkey
andvalue
properties- Parameters:
key
- Value for thekey
property. NOTE: If a null key is provided it will be transformed to an empty string ("");value
- Value for thevalue
property
-
-
Method Details
-
getToken
Returns the Postman token for a variable, eg. thekey
surrounded by double curly braces{{}}
- Returns:
- String The postman token
-
getKey
returns the value of thekey
property- Specified by:
getKey
in classCollectionElement
- Returns:
- String
-
setDescription
Sets thedescription
property- Parameters:
desc
-
-
getDescription
Returns thedescription
property, or null if it is not set- Returns:
- String
-
setKey
Sets thekey
value for this property- Parameters:
key
-
-
getValue
Sets thevalue
property for this property- Returns:
- String
-
setValue
Sets thevalue
property for this variable- Parameters:
value
- The value
-
getType
Returns thetype
property for this variable- Returns:
- String the type
-
setType
Sets thetype
property for this variable- Parameters:
type
- The type, e.g., "string" or "boolean"
-
equals
-