Java Collection Element Get getAssociationCollectionObjectName(Collection currentObjectColl, Collection prevObjectColl)

Here you can find the source of getAssociationCollectionObjectName(Collection currentObjectColl, Collection prevObjectColl)

Description

This method is called to obtain name of the object within the collection.

License

BSD License

Parameter

Parameter Description
currentObjectColl currentObjectColl
prevObjectColl prevObjectColl

Return

Object Name.

Declaration

public static String getAssociationCollectionObjectName(Collection currentObjectColl,
        Collection prevObjectColl) 

Method Source Code


//package com.java2s;
/*L//from   ww  w .  j  a v a 2  s.com
 * Copyright Washington University in St. Louis, SemanticBits, Persistent Systems, Krishagni.
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/commons-module/LICENSE.txt for details.
 */

import java.util.Collection;

public class Main {
    /**
     * This method is called to obtain name of the object within the collection.
     * @param currentObjectColl currentObjectColl
     * @param prevObjectColl prevObjectColl
     * @return Object Name.
     */
    public static String getAssociationCollectionObjectName(Collection currentObjectColl,
            Collection prevObjectColl) {
        String objectName = "";
        if (currentObjectColl != null && !((Collection) currentObjectColl).isEmpty()) {
            objectName = (((Collection) currentObjectColl).iterator().next()).getClass().getName();
        } else if (prevObjectColl != null && !((Collection) prevObjectColl).isEmpty()) {
            objectName = (((Collection) prevObjectColl).iterator().next()).getClass().getName();
        }
        return objectName;
    }
}

Related

  1. getArbitraryMember(Collection s)
  2. getArray(Collection dnaCol)
  3. getArrayFromCollection( Collection collection)
  4. GetArrayFromCollection(java.util.Collection col)
  5. getArrays(Object parent, Collection collection)
  6. getAsString(Collection data, char seperator)
  7. getAsString(Collection input)
  8. getAt(Collection col, int index)
  9. getAuthzNameFromEntityName(String entityName, Collection authzProvidersNames)