Search in sources :

Example 1 with UniqueInfo

use of org.dbflute.dbmeta.info.UniqueInfo in project dbflute-core by dbflute.

the class AbstractDBMeta method getUniqueInfoList.

// -----------------------------------------------------
// Natural Unique
// --------------
/**
 * {@inheritDoc}
 */
public List<UniqueInfo> getUniqueInfoList() {
    if (_uniqueInfoList != null) {
        return _uniqueInfoList;
    }
    synchronized (this) {
        if (_uniqueInfoList != null) {
            return _uniqueInfoList;
        }
        final Method[] methods = this.getClass().getMethods();
        final List<UniqueInfo> workingList = newArrayListSized(4);
        final String prefix = "uniqueOf";
        final Class<UniqueInfo> returnType = UniqueInfo.class;
        for (Method method : methods) {
            if (method.getName().startsWith(prefix) && returnType.equals(method.getReturnType())) {
                workingList.add((UniqueInfo) DfReflectionUtil.invoke(method, this, null));
            }
        }
        _uniqueInfoList = Collections.unmodifiableList(workingList);
        return _uniqueInfoList;
    }
}
Also used : UniqueInfo(org.dbflute.dbmeta.info.UniqueInfo) Method(java.lang.reflect.Method)

Aggregations

Method (java.lang.reflect.Method)1 UniqueInfo (org.dbflute.dbmeta.info.UniqueInfo)1