public class RamlType extends Object
Raml.define(Type) or Raml.define(Type).
Basic types are available as static field instances: NUMBER, STRING, etc..| Modifier and Type | Field and Description |
|---|---|
static RamlType |
BOOLEAN
Boolean.
|
static RamlType |
DATE_TIME
DateTime.
|
static RamlType |
FILE
File.
|
static RamlType |
INTEGER
Integer.
|
static RamlType |
NUMBER
Number.
|
static RamlType |
STRING
String.
|
| Constructor and Description |
|---|
RamlType(String type)
Creates a new RAML type.
|
RamlType(String type,
String name)
Creates a new RAML type.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getExample()
Example type.
|
Integer |
getMaxLength()
Get max length.
|
Integer |
getMinLength()
Get min length.
|
String |
getPattern()
Type Pattern.
|
Map<String,Object> |
getProperties()
Object properties.
|
RamlTypeRef |
getRef()
RAML type reference.
|
String |
getType()
One of string, number, object, etc.
|
boolean |
isObject()
True if this type is an object.
|
RamlType |
newProperty(String name,
String type,
boolean required,
String... values)
Defines a new property.
|
void |
setExample(Object example)
Set example type.
|
void |
setMaxLength(Integer maxLength)
Set max length.
|
void |
setMinLength(Integer minLength)
Set min length.
|
void |
setPattern(String pattern)
Set type pattern.
|
RamlType |
toArray()
Build/make an array.
|
static RamlType |
valueOf(String name)
Get a RAML type from string.
|
public static final RamlType NUMBER
public static final RamlType INTEGER
public static final RamlType BOOLEAN
public static final RamlType STRING
public static final RamlType FILE
public static final RamlType DATE_TIME
public RamlType(String type)
type - One of number, string, object, etc.public RamlType newProperty(String name, String type, boolean required, String... values)
name - Property name.type - Property type.required - True for required.values - Enum values.public RamlTypeRef getRef()
public String getType()
public String getPattern()
public void setPattern(String pattern)
pattern - Type Pattern.public Integer getMinLength()
public void setMinLength(Integer minLength)
minLength - Min length.public Integer getMaxLength()
public void setMaxLength(Integer maxLength)
maxLength - Max length.public Map<String,Object> getProperties()
public static RamlType valueOf(String name)
name - String name.public boolean isObject()
public Object getExample()
public void setExample(Object example)
example - Example type.public RamlType toArray()
Copyright © 2021. All rights reserved.