pl.edu.icm.ceon.commons.text.YaddaStringUtils类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(64)

本文整理了Java中pl.edu.icm.ceon.commons.text.YaddaStringUtils类的一些代码示例,展示了YaddaStringUtils类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YaddaStringUtils类的具体详情如下:
包路径:pl.edu.icm.ceon.commons.text.YaddaStringUtils
类名称:YaddaStringUtils

YaddaStringUtils介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Trims surname and sets it.
 * @param surname The surname to set.
 */
public void setSurname(String surname) {
  this.surname = YaddaStringUtils.trim(surname);
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Returns concatenated surname, pedigree, firstname and middle names
 * with all non-letters removed. This method is used by synchronization
 * tool.
 * @return concatenated surname, pedigree, middle names and firstname
 * with all non-letters removed
 */
public String getCanonicalNoWhitespaceForm() {
  StringBuffer buf = new StringBuffer();
  buf.append(YaddaStringUtils.nvl(surname)).append(YaddaStringUtils.nvl(pedigree))		
    .append(YaddaStringUtils.nvl(firstName)).append(YaddaStringUtils.nvl(middleNames));
  return getCanonicalNoWhitespaceForm(buf.toString());		
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Returns null if given string is null or blank (only whitespaces)
 * @return
 */
private String nullIfBlank(String s) {
  if (s!=null) s = s.trim();
  return YaddaStringUtils.emptyStr(s) ? null : s;
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * @return List of ids of licenses in given set.
 */
public String getLicenseIds(Set<LicenseDef> licenseSet, String unresolvedLicenses) {
  if (licenseSet.isEmpty() && YaddaStringUtils.blankStr(unresolvedLicenses)) {
    return "";
  }
  StringBuffer str = new StringBuffer();
  for (LicenseDef lic : licenseSet) {
    str.append(" ").append(lic.getExtId());
  }
  if (!YaddaStringUtils.blankStr(unresolvedLicenses)) {
    str.append(" ").append(unresolvedLicenses.trim());
  }
  return str.toString().trim();
}

代码示例来源:origin: pl.edu.icm.ceon/ceon-commons

String s = str.substring(0, i);
String rest = str.substring(i+1);
int len = atoi(s);
if (len<0) {
  throw new IllegalArgumentException("Given string is not serialized string array - invalid array length '"+s+"' ("+str+")");
    lengths[j] = -1;
  } else {
    int l = atoi(s);
    if (l<0) {
      throw new IllegalArgumentException("Given string is not serialized string array - invalid length of word "+j+" '"+s+"' ("+str+")");

代码示例来源:origin: pl.edu.icm.ceon/ceon-commons

/**
 * Serializes string list to single string.
 * @see {@link #serializeStringArray(String[])}
 * @return
 */
public static String serializeStringList(List<String> list) {
  if (list==null) return "";
  StringBuffer code = new StringBuffer();
  code.append(list.size()).append(DELIMITER);
  StringBuffer buf = new StringBuffer();
  for (String s : list) {
    buf.append(nvl(s));
    if (s==null) code.append(NULL_LENGTH);
    else code.append(s.length());
    code.append(DELIMITER);
  }
  return code.append(buf).toString(); 
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * @param extId The extId to set.
 */
public void setExtId(String extId) {
  super.setExtId(extId);
  if (YaddaStringUtils.emptyStr(name)) {	// name if not set should equal to extId
    name = extId;
  }
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

public PersonalityBuilder addContact(String type, String value) {
  if(YaddaStringUtils.blankStr(value)) return this;
  Contact c = new Contact();
  c.setType(type);
  c.setText(value);
  personality.addContact(c);
  return this;
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Trims inherit and sets it
 * 
 * @param inherit
 *            The inherit to set.
 */
public void setInherit(String inherit) {
  this.inherit = YaddaStringUtils.trim(inherit);
}

代码示例来源:origin: pl.edu.icm.ceon/ceon-commons

/**
 * Serializes string array to single string. Serialized string looks like
 * <code>length#length0#length1#..#lengthN#originalStringsConcatenated</code>
 * where <code>length</code> is length of original array and
 * <code>lengthK</code> is length of Kth string in array (or N for null).
 * If array is <code>null</code> method returns empty string.
 * @return
 */
public static String serializeStringArray(String[] array) {
  if (array==null) return "";
  StringBuffer code = new StringBuffer();
  code.append(array.length).append(DELIMITER);
  StringBuffer buf = new StringBuffer();
  for (String s : array) {
    buf.append(nvl(s));
    if (s==null) code.append(NULL_LENGTH);
    else code.append(s.length());
    code.append(DELIMITER);
  }
  return code.append(buf).toString(); 
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * @return map from languages to sets of keywords with given language, no
 *         language is represented by empty string ""
 */
public Map<String, Set<Keyword>> getKeywordMap() {
  HashMap<String, Set<Keyword>> map = new HashMap<String, Set<Keyword>>();
  for (Keyword k : getKeywordSet()) {
    String lang = YaddaStringUtils.emptyStr(k.getLang()) ? "" : k.getLang();
    Set<Keyword> set = map.get(lang);
    if (set == null) {
      set = new LinkedHashSet<Keyword>();
      map.put(lang, set);
    }
    set.add(k);
  }
  return map;
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Trims rangeFrom and sets it
 * 
 * @param rangeFrom
 *            The rangeFrom to set.
 */
public void setRangeFrom(String rangeFrom) {
  this.rangeFrom = YaddaStringUtils.trim(rangeFrom);
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Returns default name of Descriptable or empty string if it doesn't exist.
 * @return
 */
public static final String getDefaultNameString(Descriptable desc) {
  if (desc==null) {
    return "";
  }
  Name name = desc.getDefaultName();
  if (name==null) {
    return "";
  }
  return YaddaStringUtils.nvl(name.getText());
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

public String getDateText(ElementDate date) {
  String ret = date.getText();
  if (YaddaStringUtils.emptyStr(ret)) {
    getDateFormat();
    java.util.Date d = date.getDate();
    if (d!=null)
      ret = format.format(d);
  }
  return ret;
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Trims text and sets it.
 * @param text
 */
public void setText(String text) {
  this.text = YaddaStringUtils.trim(text);
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Returns default description of Element or empty string if it doesn't exist.
 * @return
 */
public static final String getDefaultDescriptionString(DescriptableObject descObject) {
  Descriptable dd = descObject.getDescriptable();
  if (dd==null) return "";
  Description desc = dd.getDefaultDescription();
  if (desc==null) return "";
  return YaddaStringUtils.nvl(desc.getText());
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Trims signature and sets it.
 * @param signature The signature to set.
 */
public void setSignature(String signature) {
  this.signature = YaddaStringUtils.trim(signature);
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

String genId = YaddaStringUtils.nvl(title) + '@' + YaddaStringUtils.nvl(firstname) + '@'
    + YaddaStringUtils.nvl(surname);

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Trims postcode and sets it as address' postcode.
 * @param postcode The postcode to set.
 */
public void setPostcode(String postcode) {
  this.postcode = YaddaStringUtils.trim(postcode);
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-old-models

/**
 * Returns default name of Element or empty string if it doesn't exist.
 * @return
 */
public static final String getDefaultNameString(DescriptableObject element) {
  Descriptable desc = element.getDescriptable();
  if (desc==null) {
    return "";
  }
  Name name = desc.getDefaultName();
  if (name==null) {
    return "";
  }
  return YaddaStringUtils.nvl(name.getText());
}

相关文章