Package org.jboss.resteasy.spi.config
Class Options<T>
- java.lang.Object
-
- org.jboss.resteasy.spi.config.Options<T>
-
public class Options<T> extends Object
Configuration options to be looked up in theConfiguration
. Unless noted all options are optional and return a default value if the value was not found in the configuration.- Author:
- James R. Perkins
-
-
Field Summary
Fields Modifier and Type Field Description static Options<Boolean>
ENABLE_DEFAULT_EXCEPTION_MAPPER
An option for enabling or disabling the default exception mapper.static Options<Threshold>
ENTITY_FILE_THRESHOLD
An option for the threshold of theEntityOutputStream
to write to a file.static Options<Threshold>
ENTITY_MEMORY_THRESHOLD
An option for the threshold of theEntityOutputStream
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
protected static <T> T
getProperty(String name, Class<T> returnType, Supplier<T> dft)
Checks theConfiguration
for the property returning the value or the given default.T
getValue()
Resolves the value from the configurationint
hashCode()
String
name()
The key for the property.String
toString()
-
-
-
Field Detail
-
ENABLE_DEFAULT_EXCEPTION_MAPPER
public static final Options<Boolean> ENABLE_DEFAULT_EXCEPTION_MAPPER
An option for enabling or disabling the default exception mapper. By default the default exception mapper is enabled.
-
ENTITY_MEMORY_THRESHOLD
public static final Options<Threshold> ENTITY_MEMORY_THRESHOLD
An option for the threshold of theEntityOutputStream
. The threshold is used to determine when to offload an entity to a file out of memory.The default is 5 MB.
-
ENTITY_FILE_THRESHOLD
public static final Options<Threshold> ENTITY_FILE_THRESHOLD
An option for the threshold of theEntityOutputStream
to write to a file. A value of-1
indicates no threshold limit.The default is 50 MB.
-
-
Method Detail
-
getValue
public T getValue()
Resolves the value from the configuration- Returns:
- the value or the default value which may be
null
-
name
public String name()
The key for the property.- Returns:
- the key for the property
-
getProperty
protected static <T> T getProperty(String name, Class<T> returnType, Supplier<T> dft)
Checks theConfiguration
for the property returning the value or the given default.- Parameters:
name
- the name of the propertyreturnType
- the type of the propertydft
- the default value if the property was not found- Returns:
- the value found in the configuration or the default value
-
-