Package org.apache.juneau.rest.httppart
Class BasicNamedAttribute
java.lang.Object
org.apache.juneau.rest.httppart.BasicNamedAttribute
- All Implemented Interfaces:
- NamedAttribute
- Direct Known Subclasses:
- RequestAttribute
Implementation of a named object.
 
See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionBasicNamedAttribute(String name, Object value) Constructor.protectedCopy constructor.
- 
Method SummaryModifier and TypeMethodDescriptionProvides an object for performing assertions against the name of this pair.Provides an object for performing assertions against the value of this pair.get()If a value is present, returns the value, otherwise throwsNoSuchElementException.getName()Returns the attribute name.getValue()Returns the attribute value.booleanReturnstrue if the value exists.static BasicNamedAttributeStatic creator.static BasicNamedAttributeStatic creator with delayed value.static BasicNamedAttributeCreates aBasicNamedAttributefrom a name/value pair string (e.g.If a value is present, returns the value, otherwise returns other.toString()
- 
Constructor Details- 
BasicNamedAttributeConstructor.- Parameters:
- name- The parameter name.
- value- The POJO to serialize to the parameter value.
 
- 
BasicNamedAttributeCopy constructor.- Parameters:
- copyOf- The object to copy.
 
 
- 
- 
Method Details- 
ofStatic creator.- Parameters:
- name- The parameter name.
- value- The parameter value.
- Returns:
- A new BasicPartobject.
 
- 
ofPairCreates aBasicNamedAttributefrom a name/value pair string (e.g."Foo: bar" )- Parameters:
- pair- The pair string.
- Returns:
- A new NameValuePairobject.
 
- 
ofStatic creator with delayed value.Value is re-evaluated on each call to getValue().- Parameters:
- name- The parameter name.
- value- The parameter value supplier.
- Returns:
- A new BasicPartobject.
 
- 
assertNameProvides an object for performing assertions against the name of this pair.- Returns:
- An object for performing assertions against the name of this pair.
 
- 
assertValueProvides an object for performing assertions against the value of this pair.- Returns:
- An object for performing assertions against the value of this pair.
 
- 
getNameDescription copied from interface:NamedAttributeReturns the attribute name.- Specified by:
- getNamein interface- NamedAttribute
- Returns:
- The attribute name.
 
- 
getValueDescription copied from interface:NamedAttributeReturns the attribute value.- Specified by:
- getValuein interface- NamedAttribute
- Returns:
- The attribute value.
 
- 
isPresentReturnstrue if the value exists.This is a shortcut for calling asString().isPresent() .- Returns:
- true if the value exists.
 
- 
getIf a value is present, returns the value, otherwise throwsNoSuchElementException.This is a shortcut for calling asString().get() .- Returns:
- The value if present.
 
- 
orElseIf a value is present, returns the value, otherwise returns other.This is a shortcut for calling asString().orElse( .other )- Parameters:
- other- The other value.
- Returns:
- The value if present or the other value if not.
 
- 
toString
 
-