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


Java ISupplier类代码示例

本文整理汇总了Java中com.helger.commons.functional.ISupplier的典型用法代码示例。如果您正苦于以下问题:Java ISupplier类的具体用法?Java ISupplier怎么用?Java ISupplier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testGetNewInstanceFactory

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
@Test
public void testGetNewInstanceFactory ()
{
  // test with a valid class
  ISupplier <?> aFactory = FactoryNewInstance.create (FactoryNewInstanceTest.class);
  assertNotNull (aFactory);
  assertNotNull (aFactory.get ());

  // null parameter
  aFactory = FactoryNewInstance.create ((Class <Object>) null);
  assertNotNull (aFactory);
  assertNull (aFactory.get ());

  // class is abstract -> cannot create instance
  aFactory = FactoryNewInstance.create (AbstractClass.class);
  assertNotNull (aFactory);
  assertNull (aFactory.get ());

  // class has no default constructor -> cannot create instance
  aFactory = FactoryNewInstance.create (ClassWithoutDefaultCtor.class);
  assertNotNull (aFactory);
  assertNull (aFactory.get ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:24,代码来源:FactoryNewInstanceTest.java

示例2: AS4Profile

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
public AS4Profile (@Nonnull @Nonempty final String sID,
                   @Nonnull @Nonempty final String sDisplayName,
                   @Nonnull final ISupplier <? extends IAS4ProfileValidator> aProfileValidatorProvider,
                   @Nonnull final ISupplier <? extends PMode> aDefaultPModeProvider,
                   @Nonnull final IPModeIDProvider aPModeIDProvider)
{
  m_sID = ValueEnforcer.notEmpty (sID, "ID");
  m_sDisplayName = ValueEnforcer.notEmpty (sDisplayName, "DisplayName");
  m_aProfileValidatorProvider = ValueEnforcer.notNull (aProfileValidatorProvider, "ProfileValidatorProvider");
  m_aDefaultPModeProvider = ValueEnforcer.notNull (aDefaultPModeProvider, "aDefaultPModeProvider");
  m_aPModeIDProvider = ValueEnforcer.notNull (aPModeIDProvider, "PModeIDProvider");
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:13,代码来源:AS4Profile.java

示例3: ObjectPool

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
/**
 * Create a new object pool for a certain amount of items and a factory that
 * creates the objects on demand.
 *
 * @param nItemCount
 *        The number of items in the pool. Must be &ge; 1.
 * @param aFactory
 *        The factory to create object. May not be <code>null</code>. The
 *        factory may not create <code>null</code> objects, as this leads to
 *        an error!
 */
public ObjectPool (@Nonnegative final int nItemCount, @Nonnull final ISupplier <? extends DATATYPE> aFactory)
{
  ValueEnforcer.isGT0 (nItemCount, "ItemCount");
  ValueEnforcer.notNull (aFactory, "Factory");

  m_aAvailable = new Semaphore (nItemCount);
  m_aItems = new Object [nItemCount];
  m_aUsed = new boolean [nItemCount];
  Arrays.fill (m_aUsed, 0, nItemCount, false);
  m_aFactory = aFactory;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:23,代码来源:ObjectPool.java

示例4: getMessageIDFactory

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
@Nonnull
public ISupplier <String> getMessageIDFactory ()
{
  return m_aMessageIDFactory;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:6,代码来源:AbstractAS4Client.java

示例5: getFactory

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
/**
 * @return The factory for filling missing values as provided in the
 *         constructor.
 */
@Nonnull
public ISupplier <? extends ELEMENTTYPE> getFactory ()
{
  return m_aFactory;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:10,代码来源:SafeVector.java

示例6: getFilenameProvider

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
/**
 * @return The filename provider used internally to build filenames. Never
 *         <code>null</code>.
 */
@Nonnull
public final ISupplier <String> getFilenameProvider ()
{
  return m_aFilenameProvider;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:10,代码来源:AbstractWALDAO.java

示例7: AbstractSimpleDAO

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
protected AbstractSimpleDAO (@Nonnull final IFileRelativeIO aIO, @Nonnull final ISupplier <String> aFilenameProvider)
{
  m_aIO = ValueEnforcer.notNull (aIO, "IO");
  m_aFilenameProvider = ValueEnforcer.notNull (aFilenameProvider, "FilenameProvider");
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:6,代码来源:AbstractSimpleDAO.java

示例8: HasInputStream

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
public HasInputStream (@Nonnull final ISupplier <? extends InputStream> aISP, final boolean bReadMultiple)
{
  m_aISP = ValueEnforcer.notNull (aISP, "ISP");
  m_bReadMultiple = bReadMultiple;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:6,代码来源:HasInputStream.java

示例9: multiple

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
@Nonnull
@ReturnsMutableCopy
public static HasInputStream multiple (@Nonnull final ISupplier <? extends InputStream> aISP)
{
  return new HasInputStream (aISP, true);
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:7,代码来源:HasInputStream.java

示例10: once

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
@Nonnull
@ReturnsMutableCopy
public static HasInputStream once (@Nonnull final ISupplier <? extends InputStream> aISP)
{
  return new HasInputStream (aISP, false);
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:7,代码来源:HasInputStream.java

示例11: setAS2ClientFactory

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
/**
 * Set the factory to create {@link AS2Client} objects internally. Overwrite
 * this if you need a proxy in the AS2Client object. By default a new instance
 * of AS2Client is created so you don't need to call this method.
 *
 * @param aAS2ClientFactory
 *        The factory to be used. May not be <code>null</code>.
 * @return this for chaining
 */
@Nonnull
public AS2ClientBuilder setAS2ClientFactory (@Nonnull final ISupplier <AS2Client> aAS2ClientFactory)
{
  m_aAS2ClientFactory = ValueEnforcer.notNull (aAS2ClientFactory, "AS2ClientFactory");
  return this;
}
 
开发者ID:phax,项目名称:as2-peppol-client,代码行数:16,代码来源:AS2ClientBuilder.java

示例12: setMessageIDFactory

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
/**
 * Set the factory that creates message IDs. By default a random UUID is used.
 *
 * @param aMessageIDFactory
 *        Factory to be used. May not be <code>null</code>.
 */
public void setMessageIDFactory (@Nonnull final ISupplier <String> aMessageIDFactory)
{
  ValueEnforcer.notNull (aMessageIDFactory, "MessageIDFactory");
  m_aMessageIDFactory = aMessageIDFactory;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:12,代码来源:AbstractAS4Client.java

示例13: SafeVector

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
/**
 * Constructor with a custom factory to fill the missing elements.
 *
 * @param aFactory
 *        The factory to use. May not be <code>null</code>.
 */
public SafeVector (@Nonnull final ISupplier <? extends ELEMENTTYPE> aFactory)
{
  m_aFactory = ValueEnforcer.notNull (aFactory, "Factory");
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:11,代码来源:SafeVector.java

示例14: SafeArrayList

import com.helger.commons.functional.ISupplier; //导入依赖的package包/类
/**
 * Constructor with a custom factory to fill the missing elements.
 *
 * @param aFactory
 *        The factory to use. May not be <code>null</code>.
 */
public SafeArrayList (@Nonnull final ISupplier <? extends ELEMENTTYPE> aFactory)
{
  m_aFactory = ValueEnforcer.notNull (aFactory, "Factory");
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:11,代码来源:SafeArrayList.java


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