/** * Create a new extension * @param t The type of the extension * @param name The name of the extension * @param required Whether the extension is required or optional * @throws IllegalArgumentException If name or t are {@code null} */ public Extension(final ExtensionType t, final String name, final boolean required) { if ( t == null || name == null ) { throw new IllegalArgumentException("Argument must not be null"); } this.type = t; this.name = name; this.required = required; if ( t == ExtensionType.ARTIFACTS ) { this.artifacts = new Artifacts(); } else { this.artifacts = null; } }