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

com.unboundid.scim.sdk.MultiValuedSCIMAttributeValue Maven / Gradle / Ivy

Go to download

The UnboundID SCIM SDK is a library that may be used to interact with various types of SCIM-enabled endpoints (such as the UnboundID server products) to perform lightweight, cloud-based identity management via the SCIM Protocol. See http://www.simplecloud.info for more information.

There is a newer version: 1.8.26
Show newest version
/*
 * Copyright 2014-2016 UnboundID Corp.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License (GPLv2 only)
 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see .
 */

package com.unboundid.scim.sdk;

import java.util.Map;

/**
 * SCIMAttributeValue implementation for the a value of a multi-valued
 * attribute. This is a hybrid simple and complex attribute value where
 * getting the simple value will return the the normative value sub-attribute
 * if available.
 */
class MultiValuedSCIMAttributeValue extends ComplexSCIMAttributeValue
{
  /**
   * Create a new instance of a SCIM multi-valued complex attribute value.
   *
   * @param attributes  The attributes comprising the complex value, keyed by
   *                    the name of the attribute.
   */
  MultiValuedSCIMAttributeValue(final Map attributes)
  {
    super(attributes);
  }

  @Override
  public SimpleValue getValue()
  {
    SCIMAttribute valueSubAttribute = getAttribute("value");
    if(valueSubAttribute != null)
    {
      return valueSubAttribute.getValue().getValue();
    }
    return null;
  }


  /**
   * {@inheritDoc}
   */
  @Override
  public String toString()
  {
    final StringBuilder sb = new StringBuilder();
    sb.append("MultiValuedSCIMAttributeValue{");
    sb.append("attributes=").append(getAttributes());
    sb.append('}');
    return sb.toString();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy