Package com.helger.base.thirdparty
Class ThirdPartyModule
java.lang.Object
com.helger.base.thirdparty.ThirdPartyModule
- All Implemented Interfaces:
IHasDisplayName,IThirdPartyModule,IHasVersion
The default implementation of the
IThirdPartyModule interface.- Author:
- Philip Helger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanBy default a third-party module is not optional -
Constructor Summary
ConstructorsConstructorDescriptionThirdPartyModule(@NonNull IThirdPartyModule aOther, boolean bOptional) Constructor copying from another third party module with a different optional flag.ThirdPartyModule(@NonNull @Nonempty String sDisplayName, @NonNull @Nonempty String sCopyrightOwner, @NonNull ILicense aLicense) Constructor with required fields and default optional flag.ThirdPartyModule(@NonNull @Nonempty String sDisplayName, @NonNull @Nonempty String sCopyrightOwner, @NonNull ILicense aLicense, boolean bOptional) Constructor with required fields and optional flag.ThirdPartyModule(@NonNull @Nonempty String sDisplayName, @NonNull @Nonempty String sCopyrightOwner, @NonNull ILicense aLicense, @Nullable Version aVersion, @Nullable String sWebsiteURL) Constructor with all fields except optional flag.ThirdPartyModule(@NonNull @Nonempty String sDisplayName, @NonNull @Nonempty String sCopyrightOwner, @NonNull ILicense aLicense, @Nullable Version aVersion, @Nullable String sWebsiteURL, boolean bOptional) Full constructor with all fields. -
Method Summary
Modifier and TypeMethodDescriptionboolean@NonNull ThirdPartyModule@NonNull ThirdPartyModule@NonNull @Nonempty String@NonNull @Nonempty String@NonNull ILicense@Nullable Version@Nullable StringinthashCode()booleantoString()
-
Field Details
-
DEFAULT_OPTIONAL
public static final boolean DEFAULT_OPTIONALBy default a third-party module is not optional- See Also:
-
-
Constructor Details
-
ThirdPartyModule
Constructor copying from another third party module with a different optional flag.- Parameters:
aOther- The third party module to copy from. May not benull.bOptional-trueif the module is optional,falseotherwise.
-
ThirdPartyModule
public ThirdPartyModule(@Nonempty @NonNull @Nonempty String sDisplayName, @Nonempty @NonNull @Nonempty String sCopyrightOwner, @NonNull ILicense aLicense) Constructor with required fields and default optional flag.- Parameters:
sDisplayName- The display name. Neithernullnor empty.sCopyrightOwner- The copyright owner. Neithernullnor empty.aLicense- The license. May not benull.
-
ThirdPartyModule
public ThirdPartyModule(@Nonempty @NonNull @Nonempty String sDisplayName, @Nonempty @NonNull @Nonempty String sCopyrightOwner, @NonNull ILicense aLicense, boolean bOptional) Constructor with required fields and optional flag.- Parameters:
sDisplayName- The display name. Neithernullnor empty.sCopyrightOwner- The copyright owner. Neithernullnor empty.aLicense- The license. May not benull.bOptional-trueif the module is optional,falseotherwise.
-
ThirdPartyModule
public ThirdPartyModule(@Nonempty @NonNull @Nonempty String sDisplayName, @Nonempty @NonNull @Nonempty String sCopyrightOwner, @NonNull ILicense aLicense, @Nullable Version aVersion, @Nullable String sWebsiteURL) Constructor with all fields except optional flag.- Parameters:
sDisplayName- The display name. Neithernullnor empty.sCopyrightOwner- The copyright owner. Neithernullnor empty.aLicense- The license. May not benull.aVersion- The version. May benull.sWebsiteURL- The website URL. May benull.
-
ThirdPartyModule
public ThirdPartyModule(@Nonempty @NonNull @Nonempty String sDisplayName, @Nonempty @NonNull @Nonempty String sCopyrightOwner, @NonNull ILicense aLicense, @Nullable Version aVersion, @Nullable String sWebsiteURL, boolean bOptional) Full constructor with all fields.- Parameters:
sDisplayName- The display name. Neithernullnor empty.sCopyrightOwner- The copyright owner. Neithernullnor empty.aLicense- The license. May not benull.aVersion- The version. May benull.sWebsiteURL- The website URL. May benull.bOptional-trueif the module is optional,falseotherwise.
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein interfaceIHasDisplayName- Returns:
- The display name of this module. Neither
nullnor empty.
-
getCopyrightOwner
- Specified by:
getCopyrightOwnerin interfaceIThirdPartyModule- Returns:
- The copyright owner of this module. Neither
nullnor empty.
-
getLicense
- Specified by:
getLicensein interfaceIThirdPartyModule- Returns:
- The license of this module. Never
null.
-
getVersion
- Specified by:
getVersionin interfaceIHasVersion- Specified by:
getVersionin interfaceIThirdPartyModule- Returns:
- The version of this module. May be
null.
-
getWebSiteURL
- Specified by:
getWebSiteURLin interfaceIThirdPartyModule- Returns:
- The website URL of this module. May be
null.
-
isOptional
public boolean isOptional()- Specified by:
isOptionalin interfaceIThirdPartyModule- Returns:
trueif this module is optional,falseotherwise.
-
getAsOptionalCopy
- Specified by:
getAsOptionalCopyin interfaceIThirdPartyModule- Returns:
- A copy of this module with the optional flag set to
true. If already optional,thisis returned. Nevernull.
-
getAsNonOptionalCopy
- Specified by:
getAsNonOptionalCopyin interfaceIThirdPartyModule- Returns:
- A copy of this module with the optional flag set to
false. If already non-optional,thisis returned. Nevernull.
-
equals
-
hashCode
public int hashCode() -
toString
-