public RetentionRuleType convertToEntityAttribute()

in src/main/java/com/google/gcs/sdrs/dao/converter/RetentionRuleTypeConverter.java [42:61]


  public RetentionRuleType convertToEntityAttribute(String databaseRepresentation) {
    if (databaseRepresentation == null) {
      return null;
    }
    switch (databaseRepresentation) {
      case DatabaseConstants.POLICY_TYPE_GLOBAL:
        return GLOBAL;
      case DatabaseConstants.POLICY_TYPE_DATASET:
        return DATASET;
      case DatabaseConstants.POLICY_TYPE_USER:
        return USER;
      case DatabaseConstants.POLICY_TYPE_DEFAULT:
        return DEFAULT;
      default:
        throw new IllegalArgumentException(
            String.format(
                "%s is not representable as a %s",
                databaseRepresentation, RetentionRuleType.class));
    }
  }