Here you can find the source of getAssociationCollectionObjectName(Collection currentObjectColl, Collection prevObjectColl)
Parameter | Description |
---|---|
currentObjectColl | currentObjectColl |
prevObjectColl | prevObjectColl |
public static String getAssociationCollectionObjectName(Collection currentObjectColl, Collection prevObjectColl)
//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; } }