/** * Sets the ID for this statement and returns the updated statement so * multiple calls can be chained together. * <p> * Statement IDs serve to help keep track of multiple statements, and are * often used to give the statement a meaningful, human readable name. * <p> * If you do not explicitly assign an ID to a statement, a unique ID will be * automatically assigned when the statement is added to a policy. * <p> * Developers should be careful to not use the same statement ID for * multiple statements in the same policy. Reusing the same statement ID in * different policies is not a problem. * * @param id * The new statement ID for this statement. */ public Statement withId(String id) { setId(id); return this; }
private void assignUniqueStatementIds() { Set<String> usedStatementIds = new HashSet<String>(); for (Statement statement : statements) { if (statement.getId() != null) usedStatementIds.add(statement.getId()); } int counter = 0; for (Statement statement : statements) { if (statement.getId() != null) continue; while (usedStatementIds.contains(Integer.toString(++counter))); statement.setId(Integer.toString(counter)); } }
statement.setId(id.asText());
/** * Sets the ID for this statement and returns the updated statement so * multiple calls can be chained together. * <p> * Statement IDs serve to help keep track of multiple statements, and are * often used to give the statement a meaningful, human readable name. * <p> * If you do not explicitly assign an ID to a statement, a unique ID will be * automatically assigned when the statement is added to a policy. * <p> * Developers should be careful to not use the same statement ID for * multiple statements in the same policy. Reusing the same statement ID in * different policies is not a problem. * * @param id * The new statement ID for this statement. */ public Statement withId(String id) { setId(id); return this; }
/** * Sets the ID for this statement and returns the updated statement so * multiple calls can be chained together. * <p> * Statement IDs serve to help keep track of multiple statements, and are * often used to give the statement a meaningful, human readable name. * <p> * If you do not explicitly assign an ID to a statement, a unique ID will be * automatically assigned when the statement is added to a policy. * <p> * Developers should be careful to not use the same statement ID for * multiple statements in the same policy. Reusing the same statement ID in * different policies is not a problem. * * @param id The new statement ID for this statement. * @return the Statement. */ @SuppressWarnings("checkstyle:hiddenfield") public Statement withId(String id) { setId(id); return this; }
private void assignUniqueStatementIds() { Set<String> usedStatementIds = new HashSet<String>(); for (Statement statement : statements) { if (statement.getId() != null) usedStatementIds.add(statement.getId()); } int counter = 0; for (Statement statement : statements) { if (statement.getId() != null) continue; while (usedStatementIds.contains(Integer.toString(++counter))); statement.setId(Integer.toString(counter)); } }
@SuppressWarnings("checkstyle:emptystatement") private void assignUniqueStatementIds() { Set<String> usedStatementIds = new HashSet<String>(); for (Statement statement : statements) { if (statement.getId() != null) usedStatementIds.add(statement.getId()); } int counter = 0; for (Statement statement : statements) { if (statement.getId() != null) continue; while (usedStatementIds.contains(Integer.toString(++counter))) ; statement.setId(Integer.toString(counter)); } }
statement.setId(id.asText());
statement.setEffect(Effect.valueOf(reader.nextString())); } else if (JsonDocumentFields.STATEMENT_ID.equals(name)) { statement.setId(reader.nextString()); } else if (JsonDocumentFields.ACTION.equals(name)) { statement.setActions(actionsOf(reader));
/** * Sets the ID for this statement and returns the updated statement so * multiple calls can be chained together. * <p> * Statement IDs serve to help keep track of multiple statements, and are * often used to give the statement a meaningful, human readable name. * <p> * If you do not explicitly assign an ID to a statement, a unique ID will be * automatically assigned when the statement is added to a policy. * <p> * Developers should be careful to not use the same statement ID for * multiple statements in the same policy. Reusing the same statement ID in * different policies is not a problem. * * @param id * The new statement ID for this statement. */ public Statement withId(String id) { setId(id); return this; }
/** * Sets the ID for this statement and returns the updated statement so * multiple calls can be chained together. * <p> * Statement IDs serve to help keep track of multiple statements, and are * often used to give the statement a meaningful, human readable name. * <p> * If you do not explicitly assign an ID to a statement, a unique ID will be * automatically assigned when the statement is added to a policy. * <p> * Developers should be careful to not use the same statement ID for * multiple statements in the same policy. Reusing the same statement ID in * different policies is not a problem. * * @param id The new statement ID for this statement. * @return the Statement. */ @SuppressWarnings("checkstyle:hiddenfield") public Statement withId(String id) { setId(id); return this; }
/** * Sets the ID for this statement and returns the updated statement so * multiple calls can be chained together. * <p> * Statement IDs serve to help keep track of multiple statements, and are * often used to give the statement a meaningful, human readable name. * <p> * If you do not explicitly assign an ID to a statement, a unique ID will be * automatically assigned when the statement is added to a policy. * <p> * Developers should be careful to not use the same statement ID for * multiple statements in the same policy. Reusing the same statement ID in * different policies is not a problem. * * @param id The new statement ID for this statement. * @return the Statement. */ @SuppressWarnings("checkstyle:hiddenfield") public Statement withId(String id) { setId(id); return this; }
private void assignUniqueStatementIds() { Set<String> usedStatementIds = new HashSet<String>(); for (Statement statement : statements) { if (statement.getId() != null) usedStatementIds.add(statement.getId()); } int counter = 0; for (Statement statement : statements) { if (statement.getId() != null) continue; while (usedStatementIds.contains(Integer.toString(++counter))); statement.setId(Integer.toString(counter)); } }
@SuppressWarnings("checkstyle:emptystatement") private void assignUniqueStatementIds() { Set<String> usedStatementIds = new HashSet<String>(); for (Statement statement : statements) { if (statement.getId() != null) usedStatementIds.add(statement.getId()); } int counter = 0; for (Statement statement : statements) { if (statement.getId() != null) continue; while (usedStatementIds.contains(Integer.toString(++counter))) ; statement.setId(Integer.toString(counter)); } }
@SuppressWarnings("checkstyle:emptystatement") private void assignUniqueStatementIds() { Set<String> usedStatementIds = new HashSet<String>(); for (Statement statement : statements) { if (statement.getId() != null) usedStatementIds.add(statement.getId()); } int counter = 0; for (Statement statement : statements) { if (statement.getId() != null) continue; while (usedStatementIds.contains(Integer.toString(++counter))) ; statement.setId(Integer.toString(counter)); } }
statement.setId(id.asText());
statement.setEffect(Effect.valueOf(reader.nextString())); } else if (JsonDocumentFields.STATEMENT_ID.equals(name)) { statement.setId(reader.nextString()); } else if (JsonDocumentFields.ACTION.equals(name)) { statement.setActions(actionsOf(reader));
statement.setEffect(Effect.valueOf(reader.nextString())); } else if (JsonDocumentFields.STATEMENT_ID.equals(name)) { statement.setId(reader.nextString()); } else if (JsonDocumentFields.ACTION.equals(name)) { statement.setActions(actionsOf(reader));