当前位置: 首页>>代码示例>>Java>>正文


Java C.list方法代码示例

本文整理汇总了Java中org.osgl.util.C.list方法的典型用法代码示例。如果您正苦于以下问题:Java C.list方法的具体用法?Java C.list怎么用?Java C.list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.osgl.util.C的用法示例。


在下文中一共展示了C.list方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: annotatedElementLoaderProvider

import org.osgl.util.C; //导入方法依赖的package包/类
@Provides
public static AnnotatedElementLoader annotatedElementLoaderProvider() {
    return new AnnotatedElementLoader() {
        @Override
        protected List<Class<?>> load(
                Class<? extends Annotation> annoClass,
                boolean loadNonPublic,
                boolean loadAbstract
        ) {
            if (annoClass == BindingType.class) {
                if (loadNonPublic && loadAbstract) {
                    return C.list(PublicAnnotated.class, PrivateAnnotated.class, AbstractAnnotated.class);
                }
                if (loadNonPublic) {
                    return C.list(PublicAnnotated.class, PrivateAnnotated.class);
                }
                if (loadAbstract) {
                    return C.list(PublicAnnotated.class, AbstractAnnotated.class);
                }
                return C.<Class<?>>list(PublicAnnotated.class);
            }
            throw E.unsupport();
        }
    };
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:26,代码来源:AnnotatedClasses.java

示例2: typedElementLoader

import org.osgl.util.C; //导入方法依赖的package包/类
@Provides
public static TypedElementLoader typedElementLoader() {
    return new TypedElementLoader() {
        @Override
        protected List<Class> load(Class type, boolean loadNonPublic, boolean loadAbstract, boolean loadRoot) {
            if (type == Base.class) {
                List<Class> list = (List) C.newList(Derived.class);
                if (loadNonPublic) {
                    list.add(NonPublicDerived.class);
                }
                if (loadAbstract) {
                    list.add(AbstractDerived.class);
                }
                if (loadRoot) {
                    list.add(Base.class);
                }
                return list;
            }
            return C.list();
        }
    };
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:23,代码来源:TypedClasses.java

示例3: save

import org.osgl.util.C; //导入方法依赖的package包/类
@Override
public List<MODEL_TYPE> save(Iterable<MODEL_TYPE> iterable) {
    List<MODEL_TYPE> list = C.list(iterable);
    if (list.isEmpty()) {
        return list;
    }
    Transaction transaction = ebean().createTransaction(TxIsolation.READ_COMMITED);
    transaction.setBatchMode(true);
    transaction.setBatchSize(list.size());
    try {
        ebean().saveAll(list);
        transaction.commit();
    } catch (RuntimeException e) {
        transaction.rollback();
        throw e;
    } finally {
        transaction.end();
    }
    return list;
}
 
开发者ID:actframework,项目名称:act-ebean,代码行数:21,代码来源:EbeanDao.java

示例4: permissions

import org.osgl.util.C; //导入方法依赖的package包/类
/**
 *
 * @return
 */
@Override
public List<? extends Permission> permissions() {
    List<String> names = permissionNames();
    if (names.isEmpty()) {
        return C.list();
    }
    AAAContext aaa = AAA.context();
    AAAPersistentService ps = aaa.getPersistentService();
    List<Permission> perms = C.newList();
    for (String name: names) {
        Permission p = ps.findByName(name, Permission.class);
        perms.add($.notNull(p));
    }
    return perms;
}
 
开发者ID:actframework,项目名称:act-aaa-plugin,代码行数:20,代码来源:DynamicPermissionCheckHelperBase.java

示例5: init

import org.osgl.util.C; //导入方法依赖的package包/类
/**
 * Initialize the bucket instances in this ATM
 *
 * @param algorithm the dispense strategy
 * @param buckets   a list of buckets contains notes to be filled
 *                  into buckets of this ATM
 * @return this ATM instance
 */
private void init(DispenseStrategy algorithm, Iterable<? extends Bucket> buckets) {
    setStrategy(algorithm);

    for (NoteType type : NoteType.values()) {
        this.buckets.put(type, Bucket.of(type));
    }

    // this will be an readonly immutable list
    bucketList = C.list(this.buckets.values());

    // use lazy map view so that we always get backed by
    // bucketList
    bucketListView = bucketList.lazy().map(BucketView.F.CONSTRUCTOR);

    transferFrom(buckets);
}
 
开发者ID:greenlaw110,项目名称:atmsim,代码行数:25,代码来源:ATM.java

示例6: setup

import org.osgl.util.C; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
    super.setup();
    invokeLog = mock(InvokeLog.class);
    scanner = new ControllerByteCodeScanner();
    scanner.setApp(mockApp);
    eventBus = mock(EventBus.class);
    classLoader = new TestingAppClassLoader(mockApp);
    classInfoRepository = mock(ClassInfoRepository.class);
    $.setProperty(classLoader, classInfoRepository, "classInfoRepository");
    infoSrc = classLoader.controllerClassMetaInfoManager();
    scannerManager = mock(AppCodeScannerManager.class);
    when(mockApp.classLoader()).thenReturn(classLoader);
    when(mockApp.scannerManager()).thenReturn(scannerManager);
    when(mockApp.eventBus()).thenReturn(eventBus);
    when(mockAppConfig.possibleControllerClass(anyString())).thenReturn(true);
    when(mockRouter.isActionMethod(anyString(), anyString())).thenReturn(false);
    C.List<AppByteCodeScanner> scanners = C.list(scanner);
    when(scannerManager.byteCodeScanners()).thenReturn(scanners);
    InvokeLogFactory.set(invokeLog);
    ActionContext.clearCurrent();
    ctx = ActionContext.create(mockApp, mockReq, mockResp);
    ctx.saveLocal();
    base = new File("./target/test-classes");
}
 
开发者ID:actframework,项目名称:actframework,代码行数:26,代码来源:ControllerEnhancerTest.java

示例7: setup

import org.osgl.util.C; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
    super.setup();
    invokeLog = mock(InvokeLog.class);
    scanner = new MailerByteCodeScanner();
    scanner.setApp(mockApp);
    classLoader = new TestingAppClassLoader(mockApp);
    infoSrc = classLoader.mailerClassMetaInfoManager();
    scannerManager = mock(AppCodeScannerManager.class);
    when(mockApp.classLoader()).thenReturn(classLoader);
    when(mockApp.scannerManager()).thenReturn(scannerManager);
    C.List<AppByteCodeScanner> scanners = C.list(scanner);
    when(scannerManager.byteCodeScanners()).thenReturn(scanners);
    InvokeLogFactory.set(invokeLog);
    base = new File("./target/test-classes");
}
 
开发者ID:actframework,项目名称:actframework,代码行数:17,代码来源:MailerEnhancerTest.java

示例8: load

import org.osgl.util.C; //导入方法依赖的package包/类
@Override
protected List<Class> load(Class type, boolean loadNonPublic, boolean loadAbstract, boolean loadRoot) {
    if (type == ErrorHandler.class) {
        return (List)C.list(NotFoundHandler.class, InternalErrorHandler.class);
    }
    return C.list();
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:8,代码来源:SimpleTypeElementLoader.java

示例9: logs

import org.osgl.util.C; //导入方法依赖的package包/类
@Command(name = "log.list", help = "List job logs")
@PropertySpec("this as log")
@GetAction("/log")
public static List<String> logs(
        @Optional(help = "limit the lines returned") Integer limit
) {
    if (null != limit && limit > 0) {
        return logs.take(limit);
    } else {
        return C.list(logs);
    }
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:13,代码来源:JobLog.java

示例10: ReflectedSimpleEventListener

import org.osgl.util.C; //导入方法依赖的package包/类
ReflectedSimpleEventListener(String className, String methodName, List<BeanSpec> paramTypes, boolean isStatic) {
    this.isStatic = isStatic;
    this.paramTypes = C.newList();
    this.providedParamTypes = C.newList();
    DependencyInjector injector = Act.injector();
    boolean cutOff = false;
    if (null == paramTypes) {
        paramTypes = C.list();
    }
    for (int i = paramTypes.size() - 1; i >= 0; --i) {
        BeanSpec spec = paramTypes.get(i);
        if (ParamValueLoaderService.provided(spec, injector)) {
            E.unexpectedIf(cutOff, "provided(injected) argument must be put at the end of passed in argument list");
            providedParamTypes.add(spec.rawType());
        } else {
            cutOff = true;
            this.paramTypes.add(spec.rawType());
        }
    }
    this.paramTypes = this.paramTypes.reverse();
    this.providedParamSize = this.providedParamTypes.size();
    if (providedParamSize > 0) {
        this.providedParamTypes = this.providedParamTypes.reverse();
    }
    Class[] argList = new Class[paramTypes.size()];
    for (int i = 0; i < argList.length; ++i) {
        argList[i] = paramTypes.get(i).rawType();
    }
    this.hostClass = Act.app().classForName(className);
    this.method = $.getMethod(hostClass, methodName, argList);
    this.isAsync = EventBus.isAsync(hostClass) || EventBus.isAsync(method);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:33,代码来源:ReflectedSimpleEventListener.java

示例11: getEmailListConfig

import org.osgl.util.C; //导入方法依赖的package包/类
private List<InternetAddress> getEmailListConfig(String key, Map<String, String> properties) {
    String s = getProperty(key, properties);
    if (S.blank(s)) {
        return C.list();
    }
    List<InternetAddress> l = new ArrayList<>();
    return MailerContext.canonicalRecipients(l, s);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:9,代码来源:MailerConfig.java

示例12: fallBack

import org.osgl.util.C; //导入方法依赖的package包/类
private List<String> fallBack(String value) {
    Boolean mercy = attribute(ATTR_MERCY);
    if (null == mercy) {
        mercy = false;
    }
    return mercy ? C.list(value) : C.<String>list();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:8,代码来源:ContentLinesResolver.java

示例13: timers

import org.osgl.util.C; //导入方法依赖的package包/类
@Override
public List<MetricInfo> timers() {
    Set<MetricInfo> set = C.newSet();
    for (Map.Entry<String, AtomicLong> entry : timers.entrySet()) {
        set.add(new MetricInfo(entry.getKey(), entry.getValue().get(), counters.get(entry.getKey()).get()));
    }
    return C.list(set);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:9,代码来源:SimpleMetricStore.java

示例14: dbHookers

import org.osgl.util.C; //导入方法依赖的package包/类
public List<DbHooker> dbHookers() {
    return C.list(dbHookers);
}
 
开发者ID:actframework,项目名称:act-storage,代码行数:4,代码来源:StorageServiceManager.java

示例15: listFoo

import org.osgl.util.C; //导入方法依赖的package包/类
@GetAction("/foo")
public List<Foo> listFoo() {
    return C.list(foo1, foo2);
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:5,代码来源:AutoObjectApp.java


注:本文中的org.osgl.util.C.list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。