implements org.apache.logging.log4j.core.util.Builder<AlertAppender> { @PluginBuilderAttribute private boolean debug; @PluginBuilderAttribute private boolean startPaused = START_PAUSED_BY_DEFAULT;
@Override public Object visit(final Configuration configuration, final Node node, final LogEvent event, final StringBuilder log) { final String overridden = this.annotation.value(); final String name = overridden.isEmpty() ? this.member.getName() : overridden; final Map<String, String> attributes = node.getAttributes(); final String rawValue = removeAttributeValue(attributes, name, this.aliases); final String replacedValue = this.substitutor.replace(event, rawValue); final Object value = convert(replacedValue, null); final Object debugValue = this.annotation.sensitive() ? NameUtil.md5(value + this.getClass().getName()) : value; StringBuilders.appendKeyDqValue(log, name, debugValue); return value; } }
implements org.apache.logging.log4j.core.util.Builder<LogWriterAppender> { @PluginBuilderAttribute private String memberName; @PluginBuilderAttribute private boolean security; @PluginBuilderAttribute private boolean appendLog = true; @PluginBuilderAttribute private boolean startPaused = START_PAUSED_BY_DEFAULT; @PluginBuilderAttribute private boolean debug;
implements org.apache.logging.log4j.core.util.Builder<GeodeConsoleAppender> { @PluginBuilderAttribute @Required private Target target = DEFAULT_TARGET; @PluginBuilderAttribute private boolean follow; @PluginBuilderAttribute private boolean direct; @PluginBuilderAttribute private boolean startPaused = START_PAUSED_BY_DEFAULT; @PluginBuilderAttribute private boolean debug;
@PluginBuilderAttribute @Required(message = "A name for the RocketmqLog4j2Appender must be specified") private String name; private Filter filter; @PluginBuilderAttribute private boolean ignoreExceptions; @PluginBuilderAttribute private String tag; @PluginBuilderAttribute private String nameServerAddress; @PluginBuilderAttribute private String producerGroup; @PluginBuilderAttribute @Required(message = "A topic name must be specified") private String topic;
public static class Builder<T> implements org.apache.logging.log4j.core.util.Builder<ValidatingPluginWithTypedBuilder> { @PluginBuilderAttribute @Required(message = "The name given by the builder is null") private String name; public Builder<T> withName(final String name) { this.name = name; return this; } @Override public ValidatingPluginWithTypedBuilder build() { return new ValidatingPluginWithTypedBuilder(name); } } }
public static class Builder implements org.apache.logging.log4j.core.util.Builder<ValidatingPlugin> { @PluginBuilderAttribute @Required(message = "The name given by the builder is null") private String name; public Builder withName(final String name) { this.name = name; return this; } @Override public ValidatingPlugin build() { return new ValidatingPlugin(name); } } }
public static abstract class Builder<B extends Builder<B>> { @PluginBuilderAttribute @Required(message = "The thing given by the builder is null") private String thing; @SuppressWarnings("unchecked") public B asBuilder() { return (B) this; } public String getThing() { return thing; } public B withThing(final String name) { this.thing = name; return asBuilder(); } }
public static class Builder<B extends Builder<B>> implements org.apache.logging.log4j.core.util.Builder<ValidatingPluginWithGenericBuilder> { @PluginBuilderAttribute @Required(message = "The name given by the builder is null") private String name; public B withName(final String name) { this.name = name; return asBuilder(); } @SuppressWarnings("unchecked") public B asBuilder() { return (B) this; } @Override public ValidatingPluginWithGenericBuilder build() { return new ValidatingPluginWithGenericBuilder(name); } } }
public static class Builder<B extends Builder<B>> extends AbstractPluginWithGenericBuilder.Builder<B> implements org.apache.logging.log4j.core.util.Builder<PluginWithGenericSubclassFoo1Builder> { @PluginBuilderFactory public static <B extends Builder<B>> B newBuilder() { return new Builder<B>().asBuilder(); } @PluginBuilderAttribute @Required(message = "The foo1 given by the builder is null") private String foo1; @Override public PluginWithGenericSubclassFoo1Builder build() { return new PluginWithGenericSubclassFoo1Builder(getThing(), getFoo1()); } public String getFoo1() { return foo1; } public B withFoo1(final String foo1) { this.foo1 = foo1; return asBuilder(); } }
public static class Builder implements org.apache.logging.log4j.core.util.Builder<ListAppender> { @PluginBuilderAttribute @Required private String name; @PluginBuilderAttribute private boolean entryPerNewLine; @PluginBuilderAttribute private boolean raw;
public static class Builder<B extends Builder<B>> extends AbstractAppender.Builder<B> implements org.apache.logging.log4j.core.util.Builder<ServletAppender> { @PluginBuilderAttribute private boolean logThrowables;
@PluginBuilderAttribute @Required(message = "A name for the RocketmqLog4j2Appender must be specified") private String name; private Filter filter; @PluginBuilderAttribute private boolean ignoreExceptions; @PluginBuilderAttribute private String tag; @PluginBuilderAttribute private String nameServerAddress; @PluginBuilderAttribute private String producerGroup; @PluginBuilderAttribute @Required(message = "A topic name must be specified") private String topic;
public static class Builder implements org.apache.logging.log4j.core.util.Builder<KeyValuePair> { @PluginBuilderAttribute private String key; @PluginBuilderAttribute private String value; public Builder setKey(final String aKey) { this.key = aKey; return this; } public Builder setValue(final String aValue) { this.value = aValue; return this; } @Override public KeyValuePair build() { return new KeyValuePair(key, value); } }
public static class Builder implements org.apache.logging.log4j.core.util.Builder<PatternMatch>, Serializable { private static final long serialVersionUID = 1L; @PluginBuilderAttribute private String key; @PluginBuilderAttribute private String pattern; public Builder setKey(final String key) { this.key = key; return this; } public Builder setPattern(final String pattern) { this.pattern = pattern; return this; } @Override public PatternMatch build() { return new PatternMatch(key, pattern); } protected Object readResolve() throws ObjectStreamException { return new PatternMatch(key, pattern); } }
public static class Builder<B extends Builder<B>> extends AbstractJacksonLayout.Builder<B> implements org.apache.logging.log4j.core.util.Builder<JsonLayout> { @PluginBuilderAttribute private boolean propertiesAsList; public Builder() { super(); setCharset(StandardCharsets.UTF_8); } @Override public JsonLayout build() { final boolean encodeThreadContextAsList = isProperties() && propertiesAsList; final String headerPattern = toStringOrNull(getHeader()); final String footerPattern = toStringOrNull(getFooter()); return new JsonLayout(getConfiguration(), isLocationInfo(), isProperties(), encodeThreadContextAsList, isComplete(), isCompact(), getEventEol(), headerPattern, footerPattern, getCharset(), isIncludeStacktrace(), isStacktraceAsString(), isIncludeNullDelimiter()); } public boolean isPropertiesAsList() { return propertiesAsList; } public B setPropertiesAsList(final boolean propertiesAsList) { this.propertiesAsList = propertiesAsList; return asBuilder(); } }
public static class Builder implements org.apache.logging.log4j.core.util.Builder<UnlimitedResizePolicy> { /** * Default resize factor */ public static final double DEFAULT_RESIZE_FACTOR = 0.50; @PluginBuilderAttribute private double resizeFactor = DEFAULT_RESIZE_FACTOR; @Override public UnlimitedResizePolicy build() { if (resizeFactor <= 0) { throw new ConfigurationException("resizeFactor must be higher than 0"); } if (resizeFactor > 1) { throw new ConfigurationException("resizeFactor must be lower or equal 1"); } return new UnlimitedResizePolicy(resizeFactor); } /** * @param resizeFactor fraction of {@link ItemSourcePool#getInitialSize()} by which given pool will be increased, e.g.: * GIVEN given initial pool size is 100 and resizeFactor is 0.5 * WHEN pool is resized 3 times * THEN total pooled items is 250 * @return this */ public Builder withResizeFactor(double resizeFactor) { this.resizeFactor = resizeFactor; return this; } }
public static class Builder implements org.apache.logging.log4j.core.util.Builder<UnlimitedResizePolicy> { /** * Default resize factor */ public static final double DEFAULT_RESIZE_FACTOR = 0.50; @PluginBuilderAttribute private double resizeFactor = DEFAULT_RESIZE_FACTOR; @Override public UnlimitedResizePolicy build() { if (resizeFactor <= 0) { throw new ConfigurationException("resizeFactor must be higher than 0"); } if (resizeFactor > 1) { throw new ConfigurationException("resizeFactor must be lower or equal 1"); } return new UnlimitedResizePolicy(resizeFactor); } /** * @param resizeFactor fraction of {@link ItemSourcePool#getInitialSize()} by which given pool will be increased, e.g.: * GIVEN given initial pool size is 100 and resizeFactor is 0.5 * WHEN pool is resized 3 times * THEN total pooled items is 250 * @return this */ public Builder withResizeFactor(double resizeFactor) { this.resizeFactor = resizeFactor; return this; } }
public static class Builder implements org.apache.logging.log4j.core.util.Builder<JacksonMixIn> { @PluginBuilderAttribute("targetClass") private String targetClassName; @PluginBuilderAttribute("mixInClass") private String mixInClassName;
public static class Builder implements org.apache.logging.log4j.core.util.Builder<JacksonMixIn> { @PluginBuilderAttribute("targetClass") private String targetClassName; @PluginBuilderAttribute("mixInClass") private String mixInClassName;