本文整理汇总了Java中com.helger.commons.ValueEnforcer.notNull方法的典型用法代码示例。如果您正苦于以下问题:Java ValueEnforcer.notNull方法的具体用法?Java ValueEnforcer.notNull怎么用?Java ValueEnforcer.notNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.helger.commons.ValueEnforcer
的用法示例。
在下文中一共展示了ValueEnforcer.notNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addToMimeMultipart
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public void addToMimeMultipart (@Nonnull final MimeMultipart aMimeMultipart) throws MessagingException
{
ValueEnforcer.notNull (aMimeMultipart, "MimeMultipart");
final MimeBodyPart aMimeBodyPart = new MimeBodyPart ();
aMimeBodyPart.setHeader (CHttpHeader.CONTENT_ID, getId ());
// !IMPORTANT! DO NOT CHANGE the order of the adding a DH and then the last
// headers
// On some tests the datahandler did reset content-type and transfer
// encoding, so this is now the correct order
aMimeBodyPart.setDataHandler (new DataHandler (_getAsDataSource ()));
// After DataHandler!!
aMimeBodyPart.setHeader (CHttpHeader.CONTENT_TYPE, getMimeType ());
aMimeBodyPart.setHeader (CHttpHeader.CONTENT_TRANSFER_ENCODING, getContentTransferEncoding ().getID ());
aMimeMultipart.addBodyPart (aMimeBodyPart);
}
示例2: CryptoProperties
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public CryptoProperties (@Nonnull final IReadableResource aRes)
{
ValueEnforcer.notNull (aRes, "Resource");
if (aRes.exists ())
try
{
m_aProps = new NonBlockingProperties ();
try (final InputStream aIS = aRes.getInputStream ())
{
m_aProps.load (aIS);
}
}
catch (final Throwable t)
{
throw new InitializationException ("Failed to init CryptoProperties from resource " + aRes + "!", t);
}
}
示例3: PModeLegErrorHandling
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public PModeLegErrorHandling (@Nullable final PModeAddressList aReportSenderErrorsTo,
@Nullable final PModeAddressList aReportReceiverErrorsTo,
@Nonnull final ETriState eReportAsResponse,
@Nonnull final ETriState eReportProcessErrorNotifyConsumer,
@Nonnull final ETriState eReportProcessErrorNotifyProducer,
@Nonnull final ETriState eReportDeliveryFailuresNotifyProducer)
{
m_aReportSenderErrorsTo = aReportSenderErrorsTo;
m_aReportReceiverErrorsTo = aReportReceiverErrorsTo;
m_eReportAsResponse = ValueEnforcer.notNull (eReportAsResponse, "ReportAsResponse");
m_eReportProcessErrorNotifyConsumer = ValueEnforcer.notNull (eReportProcessErrorNotifyConsumer,
"ReportProcessErrorNotifyConsumer");
m_eReportProcessErrorNotifyProducer = ValueEnforcer.notNull (eReportProcessErrorNotifyProducer,
"ReportProcessErrorNotifyProducer");
m_eReportDeliveryFailuresNotifyProducer = ValueEnforcer.notNull (eReportDeliveryFailuresNotifyProducer,
"ReportDeliveryFailuresNotifyProducer");
}
示例4: validateUserMessage
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public void validateUserMessage (@Nonnull final Ebms3UserMessage aUserMsg, @Nonnull final ErrorList aErrorList)
{
ValueEnforcer.notNull (aUserMsg, "UserMsg");
if (aUserMsg.getMessageInfo () != null)
{
if (StringHelper.hasNoText (aUserMsg.getMessageInfo ().getMessageId ()))
{
aErrorList.add (_createError ("MessageID is missing but is mandatory!"));
}
}
else
{
aErrorList.add (_createError ("MessageInfo is missing but is mandatory!"));
}
if (aUserMsg.getPartyInfo () != null)
{
if (aUserMsg.getPartyInfo ().getTo () != null)
{
if (aUserMsg.getPartyInfo ().getTo ().getPartyIdCount () > 1)
{
aErrorList.add (_createError ("Only 1 PartyID is allowed in PartyTo - part"));
}
}
if (aUserMsg.getPartyInfo ().getFrom () != null)
{
if (aUserMsg.getPartyInfo ().getFrom ().getPartyIdCount () > 1)
{
aErrorList.add (_createError ("Only 1 PartyID is allowed in PartyFrom - part"));
}
}
}
else
{
aErrorList.add (_createError ("At least one PartyInfo element has to be present"));
}
}
示例5: addPayloadProfile
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public final void addPayloadProfile (@Nonnull final PModePayloadProfile aPayloadProfile)
{
ValueEnforcer.notNull (aPayloadProfile, "PayloadProfile");
final String sKey = aPayloadProfile.getName ();
if (m_aPayloadProfiles.containsKey (sKey))
throw new IllegalArgumentException ("A payload profile with the name '" + sKey + "' is already registered!");
m_aPayloadProfiles.put (sKey, aPayloadProfile);
}
示例6: WSS4JAttachmentCallbackHandler
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public WSS4JAttachmentCallbackHandler (@Nullable final Iterable <WSS4JAttachment> aAttachments,
@Nonnull final AS4ResourceManager aResMgr)
{
if (aAttachments != null)
for (final WSS4JAttachment aAttachment : aAttachments)
m_aAttachmentMap.put (aAttachment.getId (), aAttachment);
m_aResMgr = ValueEnforcer.notNull (aResMgr, "ResMgr");
}
示例7: AS4Profile
import com.helger.commons.ValueEnforcer; //导入方法依赖的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");
}
示例8: setLocale
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
@Nonnull
public AS4Handler setLocale (@Nonnull final Locale aLocale)
{
ValueEnforcer.notNull (aLocale, "Locale");
m_aLocale = aLocale;
return this;
}
示例9: PModeProperty
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public PModeProperty (@Nonnull @Nonempty final String sName,
@Nullable final String sDescription,
@Nonnull @Nonempty final String sDataType,
@Nonnull final EMandatory eMandatory)
{
m_sName = ValueEnforcer.notEmpty (sName, "Name");
m_sDescription = sDescription;
m_sDataType = ValueEnforcer.notEmpty (sDataType, "DataType");
m_eMandatory = ValueEnforcer.notNull (eMandatory, "Mandatory");
_checkDataType (sDataType);
}
示例10: STXQNameTest
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public STXQNameTest (@Nonnull final ParserQName aQName)
{
m_aQName = ValueEnforcer.notNull (aQName, "QName");
}
示例11: STXPathExpression
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public STXPathExpression (@Nonnull final ESTXPathOperator eOperator, @Nullable final ISTXExpression aExpr)
{
m_eOperator = ValueEnforcer.notNull (eOperator, "Operator");
m_aExpression = aExpr;
}
示例12: setMEP
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public final void setMEP (@Nonnull final EMEP eMEP)
{
ValueEnforcer.notNull (eMEP, "MEP");
m_eMEP = eMEP;
}
示例13: AS4ReceiptMessage
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public AS4ReceiptMessage (@Nonnull final ESOAPVersion eSOAPVersion, @Nonnull final Ebms3SignalMessage aSignalMessage)
{
super (eSOAPVersion, EAS4MessageType.RECEIPT);
ValueEnforcer.notNull (aSignalMessage, "SignalMessage");
m_aMessaging.addSignalMessage (aSignalMessage);
}
示例14: BuiltMessage
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public BuiltMessage (@Nonnull @Nonempty final String sMessageID, @Nonnull final HttpEntity aHttpEntity)
{
m_sMessageID = ValueEnforcer.notEmpty (sMessageID, "MessageID");
m_aHttpEntity = ValueEnforcer.notNull (aHttpEntity, "HttpEntity");
}
示例15: HttpMimeMessageEntity
import com.helger.commons.ValueEnforcer; //导入方法依赖的package包/类
public HttpMimeMessageEntity (@Nonnull final MimeMessage aMsg)
{
m_aMsg = ValueEnforcer.notNull (aMsg, "Msg");
}