Class OwnershipDescription
java.lang.Object
com.synopsys.arc.jenkins.plugins.ownership.OwnershipDescription
- All Implemented Interfaces:
Serializable
Contains description of item's ownership.
This class is a main information entry for all ownership features.
- Since:
- 0.0.3
- Author:
- Oleg Nenashev
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OwnershipDescriptionDisabled description, which means that ownership is disabled -
Constructor Summary
ConstructorsConstructorDescriptionOwnershipDescription(boolean ownershipEnabled, String primaryOwnerId) Deprecated.Use constructor with secondary owners specificationOwnershipDescription(boolean ownershipEnabled, String primaryOwnerId, Collection<String> secondaryOwnerIds) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidassign(OwnershipDescription descr) booleanDeprecated.Deprecated.Deprecated.Deprecated.Deprecated.Get primary owner.Gets primary owner's e-mail.Gets id of primary owner.Gets e-mails of secondary owners.Gets list of secondary owners.inthashCode()booleanstatic booleanisEnabled(OwnershipDescription descr) Check if ownership is enabled.booleanCheck if User is an owner.booleanCheck if ownership is enabled.booleanisPrimaryOwner(User user) Checks if the specified user is a primary owner.static OwnershipDescriptionParse(net.sf.json.JSONObject formData) Deprecated.UseparseJSON(net.sf.json.JSONObject)instead.static OwnershipDescriptionparseJSON(net.sf.json.JSONObject formData) Parse a JSON input to construct the ownership description.protected ObjecttoString()
-
Field Details
-
DISABLED_DESCR
Disabled description, which means that ownership is disabled
-
-
Constructor Details
-
OwnershipDescription
Deprecated.Use constructor with secondary owners specificationConstructor.- Parameters:
ownershipEnabled- indicates that the ownership is enabledprimaryOwnerId- userId of primary owner
-
OwnershipDescription
public OwnershipDescription(boolean ownershipEnabled, @Nullable String primaryOwnerId, @Nullable Collection<String> secondaryOwnerIds) Constructor. Class is being used as DataBound inOwnerNodeProperty.- Parameters:
ownershipEnabled- Indicates that the ownership is enabled.primaryOwnerId- userId of primary owner. Use null if there is no ownersecondaryOwnerIds- userIds of secondary owners. Usenullif there is no secondary owners.
-
-
Method Details
-
assign
-
toString
-
isOwnershipEnabled
public boolean isOwnershipEnabled()Check if ownership is enabled.- Returns:
- true if ownership is enabled
-
getPrimaryOwnerId
Gets id of primary owner.- Returns:
- userId of the primary owner. The result will be "unknown" if the user is not specified.
-
getPrimaryOwner
Get primary owner.- Returns:
- Primary owner's user. The result may be null if someone deletes a user.
-
getCoownersIds
Deprecated.Gets list of secondary owners (fka co-owners).- Returns:
- Collection of secondary owners
-
getSecondaryOwnerIds
Gets list of secondary owners.- Returns:
- Collection of secondary owners
- Since:
- 0.9
-
Parse
@Nonnull @Deprecated public static OwnershipDescription Parse(net.sf.json.JSONObject formData) throws Descriptor.FormException Deprecated.UseparseJSON(net.sf.json.JSONObject)instead.- Throws:
Descriptor.FormException
-
parseJSON
@Nonnull public static OwnershipDescription parseJSON(net.sf.json.JSONObject formData) throws Descriptor.FormException Parse a JSON input to construct the ownership description.- Parameters:
formData- Object with a data- Returns:
- Ownership Description
- Throws:
Descriptor.FormException- Parsing error
-
isOwner
Check if User is an owner.- Parameters:
user- User to be checkedincludeSecondaryOwners- Check if user belongs to secondary owners- Returns:
trueif the user belongs to primary owners (and/or secondary owners)
-
hasPrimaryOwner
public boolean hasPrimaryOwner() -
isPrimaryOwner
Checks if the specified user is a primary owner.- Parameters:
user- User to be checked- Returns:
trueif the user is a primary owner
-
getOwnerId
Deprecated.Gets ID of the primary owner.- Returns:
- userId of the primary owner. The result will be "unknown" if the user is not specified.
- Since:
- 0.9
-
getOwnerEmail
Deprecated.Gets primary owner's e-mail. This method utilizesOwnershipPluginglobal configuration to resolve emails.- Returns:
- Primary owner's e-mail or empty string if it is not available
- Since:
- 0.9
-
getPrimaryOwnerEmail
Gets primary owner's e-mail. This method utilizesOwnershipPluginglobal configuration to resolve emails.- Returns:
- Primary owner's e-mail or empty string if it is not available
- Since:
- 0.9
-
getCoOwnerIds
Deprecated.Gets a comma-separated list of co-owners.- Returns:
- List of co-owner user IDs
-
getCoOwnerEmails
Deprecated.Gets e-mails of secondary owners. This method utilizesOwnershipPluginglobal configuration to resolve emails.- Returns:
- List of secondary owner e-mails (may be empty)
-
getSecondaryOwnerEmails
Gets e-mails of secondary owners. This method utilizesOwnershipPluginglobal configuration to resolve emails.- Returns:
- List of secondary owner e-mails (may be empty)
- Since:
- 0.9
-
hashCode
public int hashCode() -
equals
-
readResolve
- Throws:
ObjectStreamException
-
isEnabled
Check if ownership is enabled.- Parameters:
descr- Ownership description (can benull)- Returns:
- True if the ownership is enabled
- Since:
- 0.1
-