Class SingleSelectCapability
java.lang.Object
io.spring.initializr.metadata.ServiceCapability<List<DefaultMetadataElement>>
io.spring.initializr.metadata.SingleSelectCapability
- All Implemented Interfaces:
Defaultable<DefaultMetadataElement>, Cloneable
public class SingleSelectCapability
extends ServiceCapability<List<DefaultMetadataElement>>
implements Defaultable<DefaultMetadataElement>
A
single select capability.- Author:
- Stephane Nicoll
-
Constructor Summary
ConstructorsConstructorDescriptionSingleSelectCapability(String id, @Nullable String title, @Nullable String description) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContent(DefaultMetadataElement element) Add an element.@Nullable DefaultMetadataElementReturn the element with the specified id ornullif no such element exists.Return the "content" of this capability.@Nullable DefaultMetadataElementReturn the default element of this capability.voidmerge(@Nullable List<DefaultMetadataElement> otherContent) Merge the content of this instance with the specified content.voidsetContent(List<DefaultMetadataElement> newContent) Replace the content with the given elements.Methods inherited from class ServiceCapability
getDescription, getId, getTitle, getType, merge, setDescription, setTitle
-
Constructor Details
-
SingleSelectCapability
-
-
Method Details
-
getContent
Description copied from class:ServiceCapabilityReturn the "content" of this capability. The structure of the content vastly depends on thetypeof the capability.- Specified by:
getContentin classServiceCapability<List<DefaultMetadataElement>>- Returns:
- the content
-
addContent
Add an element.- Parameters:
element- the element
-
setContent
Replace the content with the given elements.- Parameters:
newContent- the elements
-
getDefault
Return the default element of this capability.- Specified by:
getDefaultin interfaceDefaultable<DefaultMetadataElement>- Returns:
- the default value
-
get
Return the element with the specified id ornullif no such element exists.- Parameters:
id- the ID of the element to find- Returns:
- the element or
null
-
merge
Description copied from class:ServiceCapabilityMerge the content of this instance with the specified content.- Specified by:
mergein classServiceCapability<List<DefaultMetadataElement>>- Parameters:
otherContent- the content to merge- See Also:
-