/**
   * Sets the new enum lists for this schema. The sets in the provided maps are converted into lists, and
   * sorted according to their natural ordering.
   *
   * @param enums The new enum sets for this schema.
   */
@SuppressWarnings({"rawtypes", "unchecked"})
  public void setEnumsSetComparable(Map<String, Set<Comparable>> enums)
  {
    Preconditions.checkNotNull(enums);
    areEnumsUpdated = true;
    Map<String, List<Object>> enumsList = Maps.newHashMap();
    //Check that all the given keys are valid
    Preconditions.checkArgument(
        configurationSchema.getKeyDescriptor().getFields().getFields().containsAll(enums.keySet()),
        "The given map doesn't contain valid keys. Valid keys are %s and the provided keys are %s",
        configurationSchema.getKeyDescriptor().getFields().getFields(),
        enums.keySet());
    //Todo check the type of the objects, for now just set them on the enum.
    for (Map.Entry<String, Set<Comparable>> entry : enums.entrySet()) {
      String name = entry.getKey();
      Set<Comparable> vals = entry.getValue();
      Preconditions.checkNotNull(name);
      Preconditions.checkNotNull(vals);
      for (Object value : entry.getValue()) {
        Preconditions.checkNotNull(value);
      }
      List<Comparable> valsListComparable = Lists.newArrayList(vals);
      Collections.sort(valsListComparable);
      List<Object> valsList = (List)valsListComparable;
      enumsList.put(name, valsList);
    }
    currentEnumVals = Maps.newHashMap(enumsList);
  }
@SuppressWarnings({"rawtypes", "unchecked"})
public void setEnumsSetComparable(Map<String, Set<Comparable>> enums)
{
Preconditions.checkNotNull(enums);
areEnumsUpdated = true;
Map<String, List<Object>> enumsList = Maps.newHashMap();
//Check that all the given keys are valid
Preconditions.checkArgument(
configurationSchema.getKeyDescriptor().getFields().getFields().containsAll(enums.keySet()),
"The given map doesn't contain valid keys. Valid keys are %s and the provided keys are %s",
configurationSchema.getKeyDescriptor().getFields().getFields(),
enums.keySet());
//Todo check the type of the objects, for now just set them on the enum.
for (Map.Entry<String, Set<Comparable>> entry : enums.entrySet()) {
String name = entry.getKey();
Set<Comparable> vals = entry.getValue();
Preconditions.checkNotNull(name);
Preconditions.checkNotNull(vals);
for (Object value : entry.getValue()) {
Preconditions.checkNotNull(value);
}
List<Comparable> valsListComparable = Lists.newArrayList(vals);
Collections.sort(valsListComparable);
List<Object> valsList = (List)valsListComparable;
enumsList.put(name, valsList);
}
currentEnumVals = Maps.newHashMap(enumsList);
}
@SuppressWarnings({"rawtypes", "unchecked"})
public void setEnumsSetComparable(Map<String, Set<Comparable>> enums)
{
Preconditions.checkNotNull(enums);
areEnumsUpdated = true;
Map<String, List<Object>> enumsList = Maps.newHashMap();
//Check that all the given keys are valid
Preconditions.checkArgument(
configurationSchema.getKeyDescriptor().getFields().getFields().containsAll(enums.keySet()),
"The given map doesn't contain valid keys. Valid keys are %s and the provided keys are %s",
configurationSchema.getKeyDescriptor().getFields().getFields(),
enums.keySet());
//Todo check the type of the objects, for now just set them on the enum.
for (Map.Entry<String, Set<Comparable>> entry : enums.entrySet()) {
String name = entry.getKey();
Set<Comparable> vals = entry.getValue();
Preconditions.checkNotNull(name);
Preconditions.checkNotNull(vals);
for (Object value : entry.getValue()) {
Preconditions.checkNotNull(value);
}
List<Comparable> valsListComparable = Lists.newArrayList(vals);
Collections.sort(valsListComparable);
List<Object> valsList = (List)valsListComparable;
enumsList.put(name, valsList);
}
currentEnumVals = Maps.newHashMap(enumsList);
}
@SuppressWarnings({"rawtypes", "unchecked"})
public void setEnumsSetComparable(Map<String, Set<Comparable>> enums)
{
Preconditions.checkNotNull(enums);
areEnumsUpdated = true;
Map<String, List<Object>> enumsList = Maps.newHashMap();
//Check that all the given keys are valid
Preconditions.checkArgument(
configurationSchema.getKeyDescriptor().getFields().getFields().containsAll(enums.keySet()),
"The given map doesn't contain valid keys. Valid keys are %s and the provided keys are %s",
configurationSchema.getKeyDescriptor().getFields().getFields(),
enums.keySet());
//Todo check the type of the objects, for now just set them on the enum.
for (Map.Entry<String, Set<Comparable>> entry : enums.entrySet()) {
String name = entry.getKey();
Set<Comparable> vals = entry.getValue();
Preconditions.checkNotNull(name);
Preconditions.checkNotNull(vals);
for (Object value : entry.getValue()) {
Preconditions.checkNotNull(value);
}
List<Comparable> valsListComparable = Lists.newArrayList(vals);
Collections.sort(valsListComparable);
List<Object> valsList = (List)valsListComparable;
enumsList.put(name, valsList);
}
currentEnumVals = Maps.newHashMap(enumsList);
}