/*******************************************************************************
 * Copyright (c) 2019-04-10 @author <a href="mailto:iffiff1@gmail.com">Tyler Chen</a>.
 * All rights reserved.
 *
 * Contributors:
 *     <a href="mailto:iffiff1@gmail.com">Tyler Chen</a> - initial API and implementation.
 * Auto Generate By foreveross.com Quick Deliver Platform. 
 ******************************************************************************/
package org.iff.infra.domain.abilities;

import org.iff.infra.util.Exceptions;
import org.iff.infra.util.PreRequiredHelper;

/**
 * SingletonAble, implements this interface MUST have a public static field with name "INSTANCE".
 *
 * @author <a href="mailto:iffiff1@gmail.com">Tyler Chen</a>
 * @since 2019-04-10
 * auto generate by qdp.
 */
public interface SingletonAble {
    public static SingletonAble singletonInstance(Class<?> singletonAble) {
        PreRequiredHelper.requireNotNull(singletonAble);
        try {
            return (SingletonAble) singletonAble.getClass().getField("INSTANCE").get(null);
        } catch (Exception e) {
            Exceptions.runtime("SingletonAble there is no public static INSTANCE field declare in this class, implements first!", e);
        }
        return null;
    }
}

@@ -516,16 +516,47 @@
 ptions;%0A
+import org.iff.infra.util.FCS;%0A
 import o
@@ -1042,19 +1042,8 @@
 ble.
-getClass().
 getF
@@ -1133,16 +1133,24 @@
 runtime(
+FCS.get(
 %22Singlet
@@ -1212,18 +1212,20 @@
  in 
-this 
 class
+ %7Bname%7D
 , im
@@ -1241,16 +1241,42 @@
 first!%22,
+ singletonAble.getName()),
  e);%0A   

fix singletonAble