/** * Construct a new instance. * * @param prompt the password reset prompt (must not be {@code null} or empty) */ public PasswordResetCallback(final String prompt) { Assert.checkNotNullParam("prompt", prompt); Assert.checkNotEmptyParam("prompt", prompt); this.prompt = prompt; }
/** * Construct a new instance. * * @param distributionPoints the distribution points (must not be {@code null} or empty) */ public FreshestCRLExtension(final List<CRLDistributionPoint> distributionPoints) { super(false); Assert.checkNotNullParam("distributionPoints", distributionPoints); Assert.checkNotEmptyParam("distributionPoints", distributionPoints); this.distributionPoints = distributionPoints; }
/** * Construct a new instance. * * @param critical {@code true} to mark this extension critical (not recommended), {@code false} otherwise * @param distributionPoints the distribution points (must not be {@code null} or empty) */ public CRLDistributionPointsExtension(final boolean critical, final List<CRLDistributionPoint> distributionPoints) { super(critical); Assert.checkNotNullParam("distributionPoints", distributionPoints); Assert.checkNotEmptyParam("distributionPoints", distributionPoints); this.distributionPoints = distributionPoints; }
/** * Construct a new instance. * * @param attributes the attributes (must not be {@code null} or empty) */ public RelativeToCRLIssuerDistributionPointName(final Collection<X500AttributeTypeAndValue> attributes) { Assert.checkNotNullParam("attributes", attributes); Assert.checkNotEmptyParam("attributes", attributes); this.attributes = attributes; }
/** * Add a compound item to the builder. * * @param attributeTypeAndValues the collection of attribute-value pairs (must not be {@code null}) * @return this builder instance */ public X500PrincipalBuilder addCompoundItem(Collection<X500AttributeTypeAndValue> attributeTypeAndValues) { Assert.checkNotNullParam("attributeTypeAndValues", attributeTypeAndValues); Assert.checkNotEmptyParam("attributeTypeAndValues", attributeTypeAndValues); items.add(attributeTypeAndValues); return this; }
/** * Construct a new instance. * * @param fullName the full name (must not be {@code null} or empty) */ public FullNameDistributionPointName(final List<GeneralName> fullName) { Assert.checkNotNullParam("fullName", fullName); Assert.checkNotEmptyParam("fullName", fullName); this.fullName = fullName; }
/** * Construct a new instance. The key purpose OIDs should typically be chosen from the {@link X500 X500.OID_KP_*} constants. * * @param critical {@code true} to mark this extension as critical, {@code false} to mark it as non-critical * @param keyPurposeIds the key purpose OIDs list (must not be {@code null} or empty) */ public ExtendedKeyUsageExtension(final boolean critical, final List<String> keyPurposeIds) { super(critical); Assert.checkNotNullParam("keyPurposeIds", keyPurposeIds); Assert.checkNotEmptyParam("keyPurposeIds", keyPurposeIds); this.keyPurposeIds = keyPurposeIds; }
/** * Remove an environment variable from the process environment. * * @param key the environment variable name (must not be {@code null}) * @return this builder */ public Builder removeEnvironment(String key) { checkNotNullParam("key", key); checkNotEmptyParam("key", key); builderProcessor = builderProcessor.andThen(pb -> { pb.environment().remove(key); return pb; }); return this; }
/** * Add a command string to the list of command strings. * * @param commandString the literal string to add (must not be {@code null}) * @return this builder */ public Builder addCommand(String commandString) { checkNotNullParam("commandString", commandString); checkNotEmptyParam("commandString", commandString); builderProcessor = builderProcessor.andThen(pb -> { pb.command().add(commandString); return pb; }); return this; }
RemoteTransactionContext(List<RemoteTransactionProvider> providers, boolean clone) { Assert.checkNotNullParam("providers", providers); if (clone) { providers = Arrays.asList(providers.toArray(NO_PROVIDERS)); } Assert.checkNotEmptyParam("providers", providers); final int size = providers.size(); for (int i = 0; i < size; i++) { Assert.checkNotNullArrayParam("providers", i, providers.get(i)); } this.providers = providers; }
/** * Add an environment value to the process environment. * * @param key the environment variable name (must not be {@code null}) * @param value the environment variable value (must not be {@code null}) * @return this builder */ public Builder addEnvironment(String key, String value) { checkNotNullParam("key", key); checkNotEmptyParam("key", key); checkNotNullParam("value", value); checkNotEmptyParam("value", value); builderProcessor = builderProcessor.andThen(pb -> { pb.environment().put(key, value); return pb; }); return this; }
/** * Add multiple environment values to the process environment. The consumer is called once for every command * execution. * * @param consumer a consumer which can provide key-value pairs to add to the environment (must not be {@code null}) * @return this builder */ public Builder addEnvironment(Consumer<BiConsumer<String, String>> consumer) { checkNotNullParam("consumer", consumer); builderProcessor = builderProcessor.andThen(pb -> { consumer.accept((key, value) -> pb.environment().put(checkNotEmptyParam("key", checkNotNullParam("key", key)), checkNotEmptyParam("value", checkNotNullParam("value", value)))); return pb; }); return this; }
/** * Create an {@code SNIMatcher} which matches SNI host name strings which end with the given suffix. * * @param suffix the suffix to match (must not be {@code null} or empty) * @return the SNI matcher (not {@code null}) */ public static SNIMatcher createHostNameSuffixSNIMatcher(String suffix) { Assert.checkNotNullParam("suffix", suffix); Assert.checkNotEmptyParam("suffix", suffix); final String finalSuffix = suffix.startsWith(".") ? suffix : "." + suffix; return createHostNameStringPredicateSNIMatcher(n -> n.endsWith(finalSuffix)); }
/** * Add a command string provider to the list of command strings. The provider can add multiple strings to * the consumer that is provided to it. The provider must not provide {@code null} or empty strings. * * @param consumer the consumer which can provide the command strings to add (must not be {@code null}) * @return this builder */ public Builder addCommand(Consumer<Consumer<String>> consumer) { checkNotNullParam("commandString", consumer); builderProcessor = builderProcessor.andThen(pb -> { consumer.accept(string -> pb.command().add(checkNotEmptyParam("string", checkNotNullParam("string", string)))); return pb; }); return this; }
/** * Construct a new instance. * * @param moduleIdentifier the EJB module identifier (must not be {@code null}) * @param beanName the bean name (must not be {@code null} or empty) */ public EJBIdentifier(final EJBModuleIdentifier moduleIdentifier, final String beanName) { Assert.checkNotNullParam("moduleIdentifier", moduleIdentifier); Assert.checkNotNullParam("beanName", beanName); Assert.checkNotEmptyParam("beanName", beanName); this.moduleIdentifier = moduleIdentifier; this.beanName = beanName; }
/** * Determine if this collection contains all of the given role names. * * @param desiredRoles the roles to check. * @return {@code true} if this collection contains all of the desired roles, {@code false} otherwise. */ default boolean containsAll(Set<String> desiredRoles) { checkNotNullParam("desiredRoles", desiredRoles); checkNotEmptyParam("desiredRoles", desiredRoles); for (String current : desiredRoles) { if (contains(current) == false) { return false; } } return true; }
public LdapSecurityRealmBuilder build() { assertNotBuilt(); Assert.checkNotEmptyParam("certificateVerifiers", certificateVerifiers); built = true; addEvidenceVerifier(new X509EvidenceVerifier(certificateVerifiers)); return LdapSecurityRealmBuilder.this; }
/** * Construct a new instance. * * @param type the type class of the context object (must not be {@code null}) * @param name the name to use for permission checks (must not be {@code null} or empty) */ public ContextManager(final Class<C> type, final String name) { Assert.checkNotNullParam("type", type); Assert.checkNotNullParam("name", name); Assert.checkNotEmptyParam("name", name); this.type = type; this.name = name; // construct commonly-used permission object getPermission = new ContextPermission(name, ContextPermission.STR_GET); }
/** * Construct a new instance. * * @param appName the application name (must not be {@code null}, but may be empty) * @param moduleName the module name (must not be {@code null} or empty) * @param distinctName the distinct name (must not be {@code null}, but may be empty) */ public EJBModuleIdentifier(final String appName, final String moduleName, final String distinctName) { Assert.checkNotNullParam("appName", appName); Assert.checkNotNullParam("moduleName", moduleName); Assert.checkNotEmptyParam("moduleName", moduleName); Assert.checkNotNullParam("distinctName", distinctName); this.appName = appName; this.moduleName = moduleName; this.distinctName = distinctName; }
public RemoteDestinationOutboundSocketBindingService(final String name, final String destinationAddress, final int destinationPort, final Integer sourcePort, final boolean fixedSourcePort) { super(name, sourcePort, fixedSourcePort); Assert.checkNotNullParam("destinationAddress", destinationAddress); Assert.checkNotEmptyParam("destinationAddress", destinationAddress); Assert.checkMinimumParameter("destinationPort", 0, destinationPort); this.destinationHost = destinationAddress; this.destinationPort = destinationPort; }