/** * Create or get label (with this explicit color). * * @param name Name of the label * @param color Color to set (or modify) * @return Label found or created * @throws IOException If there is any I/O problem * @since 0.7 */ public Label createOrGet(final String name, final String color) throws IOException { final Label.Smart label; if (this.contains(name)) { label = new Label.Smart(this.labels.get(name)); if (!label.color().equals(color)) { label.color(color); } } else { label = new Label.Smart(this.labels.create(name, color)); } return label; }
/** * Create or get label (with this explicit color). * * @param name Name of the label * @param color Color to set (or modify) * @return Label found or created * @throws IOException If there is any I/O problem * @since 0.7 */ @NotNull(message = "label should not be NULL") public Label createOrGet( @NotNull(message = "name shouldn't be NULL") final String name, @NotNull(message = "color can't be NULL") final String color) throws IOException { final Label.Smart label; if (this.contains(name)) { label = new Label.Smart(this.labels.get(name)); if (!label.color().equals(color)) { label.color(color); } } else { label = new Label.Smart(this.labels.create(name, color)); } return label; }