本文整理汇总了Java中com.helger.commons.annotation.Nonempty类的典型用法代码示例。如果您正苦于以下问题:Java Nonempty类的具体用法?Java Nonempty怎么用?Java Nonempty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Nonempty类属于com.helger.commons.annotation包,在下文中一共展示了Nonempty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PModeParty
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
public PModeParty (@Nullable final String sIDType,
@Nonnull @Nonempty final String sIDValue,
@Nonnull @Nonempty final String sRole,
@Nullable final String sUserName,
@Nullable final String sPassword)
{
m_sIDType = sIDType;
m_sIDValue = ValueEnforcer.notEmpty (sIDValue, "IDValue");
m_sRole = ValueEnforcer.notEmpty (sRole, "Role");
m_sUserName = sUserName;
m_sPassword = sPassword;
m_sID = m_sIDValue;
if (!StringHelper.getNotNull (m_sIDType).equals (""))
{
m_sID = m_sIDType + ":" + m_sIDValue;
}
}
示例2: createEbms3MessageInfo
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
/**
* Create a new message info.
*
* @param sMessageID
* The message ID. May neither be <code>null</code> nor empty.
* @param sRefToMessageID
* to set the reference to the previous message needed for two way
* exchanges
* @return Never <code>null</code>.
*/
@Nonnull
public static Ebms3MessageInfo createEbms3MessageInfo (@Nonnull @Nonempty final String sMessageID,
@Nullable final String sRefToMessageID)
{
ValueEnforcer.notEmpty (sMessageID, "MessageID");
final Ebms3MessageInfo aMessageInfo = new Ebms3MessageInfo ();
aMessageInfo.setMessageId (sMessageID);
if (StringHelper.hasText (sRefToMessageID))
aMessageInfo.setRefToMessageId (sRefToMessageID);
aMessageInfo.setTimestamp (PDTXMLConverter.getXMLCalendarNowUTC ());
return aMessageInfo;
}
示例3: getTokenLocationAsString
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
/**
* @return The location of the token as a simple string. Never
* <code>null</code>. Example: <code>(1:2/3:4)</code>. If begin and
* end are identical, only one line/column value is printed:
* <code>(1:2)</code>.
*/
@Nonnull
@Nonempty
public String getTokenLocationAsString ()
{
// Begin == end?
if (m_nBeginLineNumber == m_nEndLineNumber && m_nBeginColumnNumber == m_nEndColumnNumber)
return "(" + m_nBeginLineNumber + ":" + m_nBeginColumnNumber + ")";
// Begin != end
return "(" +
m_nBeginLineNumber +
":" +
m_nBeginColumnNumber +
"/" +
m_nEndLineNumber +
":" +
m_nEndColumnNumber +
")";
}
示例4: PageSecureAllParticipants
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
public PageSecureAllParticipants (@Nonnull @Nonempty final String sID)
{
super (sID, "All participants");
m_aExportAll = addAjax ( (req, res) -> {
final IMicroDocument aDoc = new MicroDocument ();
final IMicroElement aRoot = aDoc.appendElement ("root");
final ICommonsSortedSet <IParticipantIdentifier> aAllIDs = PDMetaManager.getStorageMgr ()
.getAllContainedParticipantIDs ();
for (final IParticipantIdentifier aParticipantID : aAllIDs)
{
final String sParticipantID = aParticipantID.getURIEncoded ();
aRoot.appendElement ("item").appendText (sParticipantID);
}
res.xml (aDoc);
res.attachment ("participant-list.xml");
});
}
示例5: IndexerWorkItem
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
IndexerWorkItem (@Nonnull @Nonempty final String sID,
@Nonnull final LocalDateTime aCreationDT,
@Nonnull final IParticipantIdentifier aParticpantID,
@Nonnull final EIndexerWorkItemType eType,
@Nonnull @Nonempty final String sOwnerID,
@Nonnull @Nonempty final String sRequestingHost)
{
ValueEnforcer.notNull (sID, "ID");
ValueEnforcer.notNull (aCreationDT, "CreationDT");
ValueEnforcer.notNull (aParticpantID, "ParticpantID");
ValueEnforcer.notNull (eType, "Type");
ValueEnforcer.notNull (sOwnerID, "OwnerID");
ValueEnforcer.notNull (sRequestingHost, "RequestingHost");
m_sID = sID;
m_aCreationDT = aCreationDT;
// Ensure all objects have the same type
m_aParticipantID = new SimpleParticipantIdentifier (aParticpantID);
m_eType = eType;
m_sOwnerID = sOwnerID;
m_sRequestingHost = sRequestingHost;
}
示例6: getParticipantIDLuceneQuery
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
@Nullable
public static Query getParticipantIDLuceneQuery (@Nonnull @Nonempty final String sQueryString)
{
ValueEnforcer.notEmpty (sQueryString, "QueryString");
ValueEnforcer.notEmpty (sQueryString.trim (), "QueryString trimmed");
final IIdentifierFactory aIdentifierFactory = PDMetaManager.getIdentifierFactory ();
final IParticipantIdentifier aPI = aIdentifierFactory.parseParticipantIdentifier (_lowerCase (sQueryString));
if (aPI == null)
{
s_aLogger.warn ("Failed to convert '" + sQueryString + "' to participant ID!");
return null;
}
final Query aQuery = new TermQuery (PDField.PARTICIPANT_ID.getExactMatchTerm (aPI));
return andNotDeleted (aQuery);
}
示例7: getContactLuceneQuery
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
@Nullable
public static Query getContactLuceneQuery (@Nonnull @Nonempty final String sQueryString)
{
ValueEnforcer.notEmpty (sQueryString, "QueryString");
ValueEnforcer.notEmpty (sQueryString.trim (), "QueryString trimmed");
if (sQueryString.length () < 3)
{
s_aLogger.warn ("Contact query string '" + sQueryString + "' is too short!");
return null;
}
final Query aQuery1 = new WildcardQuery (PDField.CONTACT_TYPE.getContainsTerm (_lowerCase (sQueryString)));
final Query aQuery2 = new WildcardQuery (PDField.CONTACT_NAME.getContainsTerm (_lowerCase (sQueryString)));
final Query aQuery3 = new WildcardQuery (PDField.CONTACT_PHONE.getContainsTerm (_lowerCase (sQueryString)));
final Query aQuery4 = new WildcardQuery (PDField.CONTACT_EMAIL.getContainsTerm (_lowerCase (sQueryString)));
final Query aQuery = new BooleanQuery.Builder ().add (aQuery1, Occur.SHOULD)
.add (aQuery2, Occur.SHOULD)
.add (aQuery3, Occur.SHOULD)
.add (aQuery4, Occur.SHOULD)
.build ();
return andNotDeleted (aQuery);
}
示例8: getRegistrationDateLuceneQuery
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
@Nullable
public static Query getRegistrationDateLuceneQuery (@Nonnull @Nonempty final String sQueryString)
{
ValueEnforcer.notEmpty (sQueryString, "QueryString");
ValueEnforcer.notEmpty (sQueryString.trim (), "QueryString trimmed");
final LocalDate aLD = PDTWebDateHelper.getLocalDateFromXSD (sQueryString);
if (aLD == null)
{
s_aLogger.warn ("Registration date '" + sQueryString + "' is invalid!");
return null;
}
final Query aQuery = new TermQuery (PDField.REGISTRATION_DATE.getExactMatchTerm (sQueryString));
return andNotDeleted (aQuery);
}
示例9: getDocumentTypeIDLuceneQuery
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
@Nullable
public static Query getDocumentTypeIDLuceneQuery (@Nonnull @Nonempty final String sQueryString)
{
ValueEnforcer.notEmpty (sQueryString, "QueryString");
ValueEnforcer.notEmpty (sQueryString.trim (), "QueryString trimmed");
final IIdentifierFactory aIdentifierFactory = PDMetaManager.getIdentifierFactory ();
// No casing here!
final IDocumentTypeIdentifier aDTI = aIdentifierFactory.parseDocumentTypeIdentifier (sQueryString);
if (aDTI == null)
{
s_aLogger.warn ("Failed to convert '" + sQueryString + "' to document type ID!");
return null;
}
final Query aQuery = new TermQuery (PDField.DOCTYPE_ID.getExactMatchTerm (aDTI));
return andNotDeleted (aQuery);
}
示例10: ISO639_2Item
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
public ISO639_2Item (@Nonnull @Nonempty final String sAlpha3B,
@Nullable final String sAlpha3T,
@Nullable final String sAlpha2,
@Nonnull @Nonempty final String sEN,
@Nonnull @Nonempty final String sFR)
{
ValueEnforcer.isTrue (StringHelper.getLength (sAlpha3B) == 3,
"Alpha3-bibliographic code must be present and have length 3: '" +
sAlpha3B +
"' - length " +
StringHelper.getLength (sAlpha3B));
if (sAlpha3T != null)
ValueEnforcer.isTrue (sAlpha3T.length () == 3, "Alpha3-terminologic code must have length 3!");
if (sAlpha2 != null)
ValueEnforcer.isTrue (sAlpha2.length () == 2, "Alpha2 code must have length 2!");
ValueEnforcer.notEmpty (sEN, "English name");
ValueEnforcer.notEmpty (sFR, "French name");
m_sAlpha3B = sAlpha3B;
m_sAlpha3T = sAlpha3T;
m_sAlpha2 = sAlpha2;
m_sEN = sEN;
m_sFR = sFR;
}
示例11: setVendorURL
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
public static void setVendorURL (@Nonnull @Nonempty final String sVendorURL)
{
ValueEnforcer.notEmpty (sVendorURL, "VendorURL");
final IURLProtocol aProtocol = URLProtocolRegistry.getInstance ().getProtocol (sVendorURL);
if (aProtocol == null)
{
// No protocol present - assume HTTP
s_sVendorURLWithoutProtocol = sVendorURL;
s_sVendorURL = EURLProtocol.HTTP.getWithProtocol (sVendorURL);
}
else
{
// Strip leading protocol
s_sVendorURLWithoutProtocol = sVendorURL.substring (aProtocol.getProtocol ().length ());
s_sVendorURL = sVendorURL;
}
}
示例12: UTF7Base64Helper
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
/**
* Initializes the class with the specified encoding/decoding alphabet.
*
* @param sAlphabet
* alphabet
* @throws IllegalArgumentException
* if alphabet is not 64 characters long or contains characters which
* are not 7-bit ASCII
*/
public UTF7Base64Helper (@Nonnull @Nonempty final String sAlphabet)
{
m_aAlphabet = sAlphabet.toCharArray ();
if (sAlphabet.length () != ALPHABET_LENGTH)
throw new IllegalArgumentException ("alphabet has incorrect length (should be 64, not " +
sAlphabet.length () +
")");
m_aInverseAlphabet = new int [128];
Arrays.fill (m_aInverseAlphabet, -1);
for (int i = 0; i < m_aAlphabet.length; i++)
{
final char ch = m_aAlphabet[i];
if (ch >= 128)
throw new IllegalArgumentException ("invalid character in alphabet: " + ch);
m_aInverseAlphabet[ch] = i;
}
}
示例13: CSSPropertyEnumOrNumbers
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
public CSSPropertyEnumOrNumbers (@Nonnull final ECSSProperty eProp,
@Nullable final ECSSVendorPrefix eVendorPrefix,
@Nullable final ICSSPropertyCustomizer aCustomizer,
final boolean bWithPercentage,
@Nonnegative final int nMinNumbers,
@Nonnegative final int nMaxNumbers,
@Nonnull @Nonempty final String... aEnumValues)
{
super (eProp, eVendorPrefix, aCustomizer, aEnumValues);
ValueEnforcer.isGT0 (nMinNumbers, "MinNumbers");
ValueEnforcer.isGT0 (nMaxNumbers, "MaxNumbers");
if (nMaxNumbers < nMinNumbers)
throw new IllegalArgumentException ("MaxNumbers (" +
nMaxNumbers +
") must be >= MinNumbers (" +
nMinNumbers +
")");
m_bWithPercentage = bWithPercentage;
m_nMinNumbers = nMinNumbers;
m_nMaxNumbers = nMaxNumbers;
}
示例14: getAsCSSString
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
@Nonnull
@Nonempty
public String getAsCSSString (@Nonnull final ICSSWriterSettings aSettings, @Nonnegative final int nIndentLevel)
{
aSettings.checkVersionRequirements (this);
// Always ignore viewport rules?
if (!aSettings.isWriteViewportRules ())
return "";
if (aSettings.isRemoveUnnecessaryCode () && !hasDeclarations ())
return "";
final StringBuilder aSB = new StringBuilder (m_sDeclaration);
aSB.append (m_aDeclarations.getAsCSSString (aSettings, nIndentLevel));
if (!aSettings.isOptimizedOutput ())
aSB.append (aSettings.getNewLineString ());
return aSB.toString ();
}
示例15: getXML11EntityReferenceString
import com.helger.commons.annotation.Nonempty; //导入依赖的package包/类
/**
* Get the entity reference for the specified character. This returns e.g.
* &lt; for '<' etc. This method has special handling for <, >,
* &, " and '. All other chars are encoded by their numeric value
* (e.g. &#200;)
*
* @param c
* Character to use.
* @return The entity reference string. Never <code>null</code> nor empty.
*/
@Nonnull
@Nonempty
public static String getXML11EntityReferenceString (final char c)
{
if (c == LT)
return "<";
if (c == GT)
return ">";
if (c == AMPERSAND)
return "&";
if (c == DOUBLE_QUOTE)
return """;
if (c == APOS)
return "'";
if (c == '\u2028')
return "\n";
return "&#" + (int) c + ";";
}