All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pro.taskana.common.rest.models.TaskanaPagedModelKeys Maven / Gradle / Ivy

There is a newer version: 8.2.0
Show newest version
package pro.taskana.common.rest.models;

import java.util.Arrays;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;

public enum TaskanaPagedModelKeys {
  ACCESSITEMS("accessItems"),
  CLASSIFICATIONS("classifications"),
  DISTRIBUTION_TARGETS("distributionTargets"),
  TASKS("tasks"),
  TASK_COMMENTS("taskComments"),
  WORKBASKETS("workbaskets");

  private static final Map PROPERTY_MAP =
      Arrays.stream(TaskanaPagedModelKeys.values())
          .collect(Collectors.toMap(TaskanaPagedModelKeys::getPropertyName, Function.identity()));

  private final String propertyName;

  TaskanaPagedModelKeys(String propertyName) {
    this.propertyName = propertyName;
  }

  public String getPropertyName() {
    return propertyName;
  }

  public static Optional getEnumFromPropertyName(String propertyName) {
    return Optional.ofNullable(PROPERTY_MAP.get(propertyName));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy