/** * Builds a new {@link ActionsSummary ActionsSummary}. * @return An immutable instance of ActionsSummary * @throws java.lang.IllegalStateException if any required attributes are missing */ public ActionsSummary build() { return ImmutableActionsSummary.validate(new ImmutableActionsSummary(null, createUnmodifiableMap(false, false, actionCountByTags), totalActions)); } }
/** * Construct a new immutable {@code ActionsSummary} instance. * @param actionCountByTags The value for the {@code actionCountByTags} attribute * @param totalActions The value for the {@code totalActions} attribute * @return An immutable ActionsSummary instance */ public static ActionsSummary of(Map<String, ? extends Integer> actionCountByTags, int totalActions) { return validate(new ImmutableActionsSummary(actionCountByTags, totalActions)); }
/** * Copy the current immutable object by setting a value for the {@link ActionsSummary#getTotalActions() totalActions} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for totalActions * @return A modified copy of the {@code this} object */ public final ImmutableActionsSummary withTotalActions(int value) { if (this.totalActions == value) return this; return validate(new ImmutableActionsSummary(this, this.actionCountByTags, value)); }
/** * Copy the current immutable object by replacing the {@link ActionsSummary#getActionCountByTags() actionCountByTags} map with the specified map. * Nulls are not permitted as keys or values. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param entries The entries to be added to the actionCountByTags map * @return A modified copy of {@code this} object */ public final ImmutableActionsSummary withActionCountByTags(Map<String, ? extends Integer> entries) { if (this.actionCountByTags == entries) return this; Map<String, Integer> newValue = createUnmodifiableMap(true, false, entries); return validate(new ImmutableActionsSummary(this, newValue, this.totalActions)); }