com.memority.citadel.shared.api.im.ObjectKind Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of citadel-api Show documentation
Show all versions of citadel-api Show documentation
This artifact provides the API classes that are necessary to implement general configuration Rules on the Memority IM platform.
/*
* Copyright (c) 2016-2023 Memority. All Rights Reserved.
*
* This file is part of Memority Citadel API , a Memority project.
*
* This file is released under the Memority Public Artifacts End-User License Agreement,
* see
* Unauthorized copying of this file, via any medium is strictly prohibited.
*/
package com.memority.citadel.shared.api.im;
import com.fasterxml.jackson.annotation.JsonCreator;
import org.apache.commons.lang3.Validate;
import com.memority.citadel.shared.api.XmlConstants;
import javax.xml.bind.annotation.XmlType;
/**
* List the supported kinds of Managed Objects. This is a formalized mean to indicate the class with no dependency
* on the corresponding Java type.
*/
@XmlType(name = XmlConstants.NAME_TYPE_OBJECTKIND)
public enum ObjectKind {
IDENTITY, ORGANIZATION, RESOURCE, ROLE, ROLE_PUBLICATION;
// These constants are to be used in annotations, typically. Must be kept in sync with the normalized enum json values.
public static final String IDENTITY_VALUE = "IDENTITY";
public static final String ORGANIZATION_VALUE = "ORGANIZATION";
public static final String RESOURCE_VALUE = "RESOURCE";
public static final String ROLE_VALUE = "ROLE";
public static final String ROLE_PUBLICATION_VALUE = "ROLE_PUBLICATION";
@JsonCreator
public static ObjectKind fromJson(String jsonValue) {
Validate.notBlank(jsonValue);
return ObjectKind.valueOf(jsonValue.toUpperCase());
}
}