本文整理汇总了Java中org.osgl.util.S.fmt方法的典型用法代码示例。如果您正苦于以下问题:Java S.fmt方法的具体用法?Java S.fmt怎么用?Java S.fmt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osgl.util.S
的用法示例。
在下文中一共展示了S.fmt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compatibilityErrorMessage
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String compatibilityErrorMessage(ParamAnnoInfoTrait otherParamAnnotation) {
if ($.eq(otherParamAnnotation.getClass(), getClass())) {
return S.fmt("Duplicated annotation found: %s", getClass());
}
return null;
}
示例2: toString
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String toString() {
return S.fmt("%s[%s]", getClass().getSimpleName(), id);
}
示例3: toString
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String toString() {
return S.fmt("Foo[%s]", id);
}
示例4: toString
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String toString() {
return S.fmt("%s %s", firstName, lastName);
}
示例5: sayHi
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String sayHi(String who) {
return S.fmt("Hi %s", who);
}
示例6: sayHi
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String sayHi(String who) {
return S.fmt("Hi %s (in DEV mode)!", who);
}
示例7: bye
import org.osgl.util.S; //导入方法依赖的package包/类
public String bye(String who) {
return S.fmt("In answering request sent from [%s], we say bye %s! (in DEV mode)", request.ip(), who);
}
示例8: bye
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String bye(String who) {
return S.fmt("In answering requesting sent to [%s], we say bye %s!", context.req().url(), who);
}
示例9: toString
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String toString() {
return S.fmt("%3s|%s", getId(), getDesc());
}
示例10: hi
import org.osgl.util.S; //导入方法依赖的package包/类
public String hi(@DefaultValue("body") String who) {
return S.fmt("Hi %s, how are you going?", who);
}
示例11: bye
import org.osgl.util.S; //导入方法依赖的package包/类
public String bye() {
return S.fmt("%s, see you soon!", TO.get());
}
示例12: fullUrl
import org.osgl.util.S; //导入方法依赖的package包/类
private static String fullUrl(String pathTmpl, Object ... args) {
String tmpl0 = pathTmpl.startsWith("/") ? pathTmpl : "/" + pathTmpl;
return S.fmt(END_POINT + tmpl0, args);
}
示例13: patchedJsonBody
import org.osgl.util.S; //导入方法依赖的package包/类
/**
* Suppose method signature is: `public void foo(Foo foo)`, and a JSON content is
* not `{"foo": {foo-content}}`, then wrap it as `{"foo": body}`
*/
private String patchedJsonBody(WebSocketContext context) {
String body = context.stringMessage();
if (S.blank(body) || 1 < fieldsAndParamsCount) {
return body;
}
String theName = singleJsonFieldName(context);
int theNameLen = theName.length();
if (null == theName) {
return body;
}
body = body.trim();
boolean needPatch = body.charAt(0) == '[';
if (!needPatch) {
if (body.charAt(0) != '{') {
throw new IllegalArgumentException("Cannot parse JSON string: " + body);
}
boolean startCheckName = false;
int nameStart = -1;
for (int i = 1; i < body.length(); ++i) {
char c = body.charAt(i);
if (c == ' ') {
continue;
}
if (startCheckName) {
if (c == '"') {
break;
}
int id = i - nameStart - 1;
if (id >= theNameLen || theName.charAt(i - nameStart - 1) != c) {
needPatch = true;
break;
}
} else if (c == '"') {
startCheckName = true;
nameStart = i;
}
}
}
return needPatch ? S.fmt("{\"%s\": %s}", theName, body) : body;
}
示例14: setterSignature
import org.osgl.util.S; //导入方法依赖的package包/类
private static String setterSignature(BeanSpec spec) {
return S.fmt("(%s)V", typeDesc(spec));
}
示例15: RenderText
import org.osgl.util.S; //导入方法依赖的package包/类
public RenderText(String text, Object... args) {
super(S.fmt(text, args), H.Format.TXT, false);
}