本文整理了Java中com.phloc.commons.string.ToStringGenerator
类的一些代码示例,展示了ToStringGenerator
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ToStringGenerator
类的具体详情如下:
包路径:com.phloc.commons.string.ToStringGenerator
类名称:ToStringGenerator
ToStringGenerator介绍
[英]This is a utility class for easier toString
method creations. It assumes that the toString
method is only used for the representation of the internal state and not for creating human readable formats.
A real world example for a final class derived from Object or a base class looks like this: ``
@Override
public String toString () {
return new ToStringGenerator (this).append ("member1", member1).append ("member2", member2).toString ();
}
For a derived class, the typical code looks like this, assuming that the base class also used the ToStringGenerator: ``
@Override
public String toString () {
return ToStringGenerator.getDerived (super.toString ()).append ("member3", member3).append ("member4", member4).toString ();
}
[中]这是一个实用类,用于更简单的toString
方法创建。它假定toString
方法仅用于表示内部状态,而不用于创建人类可读的格式。
从对象或基类派生的最终类的实际示例如下:``
@Override
public String toString () {
return new ToStringGenerator (this).append ("member1", member1).append ("member2", member2).toString ();
}
对于派生类,典型的代码如下所示,假设基类也使用了ToStringGenerator:``
@Override
public String toString () {
return ToStringGenerator.getDerived (super.toString ()).append ("member3", member3).append ("member4", member4).toString ();
}
代码示例
代码示例来源:origin: com.phloc/phloc-css
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("declarations", m_aDeclarations)
.appendIfNotNull ("sourceLocation", m_aSourceLocation)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-masterdata
@Override
public String toString ()
{
return new ToStringGenerator (null).appendIfNotNull ("type", m_eType)
.appendIfNotNull ("address", m_sAddress)
.appendIfNotNull ("personal", m_sPersonal)
.toString ();
}
代码示例来源:origin: com.phloc/phloc-css
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("hue", m_sHue)
.append ("saturation", m_sSaturation)
.append ("lightness", m_sLightness)
.append ("opacity", m_sOpacity)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-html
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.append ("regex", m_sRegEx)
.append ("global", m_bGlobal)
.append ("caseInsensitive", m_bCaseInsensitive)
.append ("multiLine", m_bMultiLine)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-html
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.appendIfNotNull ("object", this.m_aObject)
.appendIfNotNull ("ctorType", this.m_aCtorType)
.appendIfNotNull ("callee", this.m_aCallee)
.appendIfNotNull ("name", this.m_sName)
.append ("args", this.m_aArgs)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-html
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ()).appendIfNotNull ("href", this.m_aHref) //$NON-NLS-1$
.appendIfNotNull ("target", this.m_aTarget) //$NON-NLS-1$
.appendIfNotNull ("name", this.m_sName) //$NON-NLS-1$
.appendIfNotNull ("type", this.m_aType) //$NON-NLS-1$
.appendIfNotNull ("mediaQuery", this.m_sMediaQuery) //$NON-NLS-1$
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-html
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.append ("colspan", m_nColspan)
.append ("rowSpan", m_nRowspan)
.append ("align", m_eAlign)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-css
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("property", m_eProperty)
.append ("subProperties", m_aSubProperties)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-html
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.append ("type", this.m_aType) //$NON-NLS-1$
.appendIfNotNull ("mediaList", this.m_aMediaList) //$NON-NLS-1$
.append ("content", this.m_sContent) //$NON-NLS-1$
.append ("mode", this.m_eMode) //$NON-NLS-1$
.append ("emitAfterFiles", this.m_bEmitAfterFiles) //$NON-NLS-1$
.toString ();
}
代码示例来源:origin: com.phloc/phloc-html
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.appendIfNotNull ("src", m_sSrc)
.appendIfNotNull ("extent", m_aExtent)
.appendIfNotNull ("alt", m_sAlt)
.toString ();
}
代码示例来源:origin: com.phloc/phloc-webctrls
@Override
public String toString ()
{
return new ToStringGenerator (this).appendIfNotNull ("formatter", m_aFormatter).toString ();
}
}
代码示例来源:origin: com.phloc/phloc-css
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("members", m_aMembers)
.appendIfNotNull ("sourceLocation", m_aSourceLocation)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-css-jdk5
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.append ("withPercentage", m_bWithPercentage)
.append ("minNumbers", m_nMinNumbers)
.append ("maxNumbers", m_nMaxNumbers)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-css
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("hue", m_sHue)
.append ("saturation", m_sSaturation)
.append ("lightness", m_sLightness)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-html
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.appendIfNotNull ("name", m_sName)
.append ("disabled", m_bDisabled)
.append ("readOnly", m_bReadOnly)
.append ("focused", m_bFocused)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-html
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.appendIfNotNull ("head", m_aHead)
.appendIfNotNull ("body", m_aBody)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-css
@Override
public String toString ()
{
return new ToStringGenerator (null).append ("funcName", m_sFunctionName)
.appendIfNotNull ("expression", m_aExpression)
.appendIfNotNull ("sourceLocation", m_aSourceLocation)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-css
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.append ("minNumbers", m_nMinNumbers)
.append ("maxNumbers", m_nMaxNumbers)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-css
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("kind", m_nKind)
.append ("beginLine", m_nBeginLine)
.append ("beginColumn", m_nBeginColumn)
.append ("endLine", m_nEndLine)
.append ("endColumn", m_nEndColumn)
.append ("image", m_sImage)
.toString ();
}
}
代码示例来源:origin: com.phloc/phloc-html
@Override
public String toString ()
{
return ToStringGenerator.getDerived (super.toString ())
.appendIfNotNull ("type", m_eType)
.appendIfNotNull ("name", m_sName)
.appendIfNotNull ("value", m_sValue)
.append ("disabled", m_bDisabled)
.toString ();
}
}