Class ProcessScope
- java.lang.Object
-
- com.sodius.oslc.core.process.model.ProcessScope
-
public class ProcessScope extends Object implements Predicate<Object>
The scope of supported standard association types and link types.An OSLC application may not necessarily support all available resource types, associations and links. For example
LinkType.TRACKS_WORK_ITEMrelates to planning and may not make sense for all Change Management applications. The application is also likely to support locally only a subset of available OSLC resource types.An application can restrict the supported associations and links to a subset of available ones by changing the
ProcessScopeat initialization time, using following code:ProcessScope.setInstance(ProcessScope.builder() // .resourceType(ResourceType.CHANGE_REQUEST) // .association(AssociationType.RELATED_TO) // .link(LinkType.RELATED_CHANGE_REQUEST) // .build());This class implements
Predicateso that a domain, resource type, association or link typesStreamcan easily be filtered with aProcessScopeinstance.- Since:
- 1.9.0
- See Also:
AssociationType,LinkType
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProcessScope.BuilderEnables configuring and creating aProcessScopeinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProcessScope.Builderbuilder()Creates a builder to configure and build a newProcessScopeinstance.booleancontains(AssociationType type)Determines if the given association type is supported by this scope instance.booleancontains(Domain domain)Determines if the given domain is supported by this scope instance, meaning one that defines a type of artifact that the local application enables managing.booleancontains(LinkType type)Determines if the given link type is supported by this scope instance.booleancontains(ResourceType type)Determines if the given resource type is supported by this scope instance, meaning one whose artifacts can be managed by that the local application.static ProcessScopegetInstance()Returns the current scope instance.static voidsetInstance(ProcessScope scope)Replaces the current scope with the given one.booleantest(Object object)Determines if the given domain, resource type, association type or link type is supported by this scope instance.
-
-
-
Method Detail
-
getInstance
public static ProcessScope getInstance()
Returns the current scope instance. Default instance supports all available resource types, associations and links.- Returns:
- the current instance.
- See Also:
setInstance(ProcessScope)
-
setInstance
public static void setInstance(ProcessScope scope)
Replaces the current scope with the given one.- Parameters:
scope- the new scope.
-
builder
public static ProcessScope.Builder builder()
Creates a builder to configure and build a newProcessScopeinstance.- Returns:
- a scope builder.
-
contains
public boolean contains(Domain domain)
Determines if the given domain is supported by this scope instance, meaning one that defines a type of artifact that the local application enables managing.- Parameters:
domain- the domain- Returns:
trueif the domain is part of the scope,falseotherwise.- Since:
- 3.5.0
-
contains
public boolean contains(ResourceType type)
Determines if the given resource type is supported by this scope instance, meaning one whose artifacts can be managed by that the local application.- Parameters:
type- the resource type- Returns:
trueif the resource type is part of the scope,falseotherwise.- Since:
- 3.5.0
-
contains
public boolean contains(AssociationType type)
Determines if the given association type is supported by this scope instance.- Parameters:
type- an association type to test.- Returns:
trueif the link type is part of the scope,falseotherwise.
-
contains
public boolean contains(LinkType type)
Determines if the given link type is supported by this scope instance.- Parameters:
type- a link type to test.- Returns:
trueif the link type is part of the scope,falseotherwise.
-
test
public boolean test(Object object)
Determines if the given domain, resource type, association type or link type is supported by this scope instance.
-
-