From 517e7f235b536f833fec11e2f0da49b8ab0f26c8 Mon Sep 17 00:00:00 2001 From: Puja Sharma Date: Wed, 6 Apr 2022 14:38:26 +0530 Subject: [PATCH] feat(jans-config-api): user management api --- .../jans/configapi/rest/model/BasePerson.java | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 jans-config-api/common/src/main/java/io/jans/configapi/rest/model/BasePerson.java diff --git a/jans-config-api/common/src/main/java/io/jans/configapi/rest/model/BasePerson.java b/jans-config-api/common/src/main/java/io/jans/configapi/rest/model/BasePerson.java deleted file mode 100644 index 9394d9eca51..00000000000 --- a/jans-config-api/common/src/main/java/io/jans/configapi/rest/model/BasePerson.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.configapi.rest.model.user; - -import io.jans.as.model.exception.InvalidClaimException; -import org.json.JSONArray; - -import java.util.List; - -public class BasePerson extends io.jans.orm.model.base.SimpleUser { - - private static final long serialVersionUID = -2634191420188575733L; - - public Object getAttribute(String attributeName, boolean optional, boolean multivalued) throws InvalidClaimException { - Object attribute = null; - - List values = getAttributeValues(attributeName); - if (values != null) { - if (multivalued) { - JSONArray array = new JSONArray(); - for (String v : values) { - array.put(v); - } - attribute = array; - } else { - attribute = values.get(0); - } - } - - if (attribute != null) { - return attribute; - } else if (optional) { - return attribute; - } else { - throw new InvalidClaimException("The claim " + attributeName + " was not found."); - } - } - -} \ No newline at end of file