本文整理汇总了Java中org.jooq.tools.StringUtils类的典型用法代码示例。如果您正苦于以下问题:Java StringUtils类的具体用法?Java StringUtils怎么用?Java StringUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringUtils类属于org.jooq.tools包,在下文中一共展示了StringUtils类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: renderEnd
import org.jooq.tools.StringUtils; //导入依赖的package包/类
@Override
public void renderEnd(ExecuteContext ctx) {
// Only join traces, don't start them. This prevents LocalCollector's thread from amplifying.
if (brave.serverSpanThreadBinder().getCurrentServerSpan() == null ||
brave.serverSpanThreadBinder().getCurrentServerSpan().getSpan() == null) {
return;
}
brave.clientTracer().startNewSpan(ctx.type().toString().toLowerCase());
String[] batchSQL = ctx.batchSQL();
if (!StringUtils.isBlank(ctx.sql())) {
brave.clientTracer().submitBinaryAnnotation(SQL_QUERY, ctx.sql());
} else if (batchSQL.length > 0 && batchSQL[batchSQL.length - 1] != null) {
brave.clientTracer().submitBinaryAnnotation(SQL_QUERY, StringUtils.join(batchSQL, '\n'));
}
brave.clientTracer()
.setClientSent(mysqlEndpoint.ipv4, mysqlEndpoint.port, mysqlEndpoint.serviceName);
}
开发者ID:liaominghua,项目名称:zipkin,代码行数:19,代码来源:TraceZipkinMySQLStorageAutoConfiguration.java
示例2: getJavaClassName
import org.jooq.tools.StringUtils; //导入依赖的package包/类
@Override
public String getJavaClassName(Definition definition, Mode mode) {
StringBuilder result = new StringBuilder();
if (mode == Mode.RECORD) {
result.append('R');
} else if (mode == Mode.DEFAULT) {
result.append('T');
} else if (mode == Mode.INTERFACE) {
result.append('I');
}
result.append(StringUtils.toCamelCase(definition.getOutputName()));
if (mode == Mode.RECORD) {
result.append("Record");
} else if (mode == Mode.DAO) {
result.append("Dao");
}
return result.toString();
}
开发者ID:nithril,项目名称:sandbox-query-benchmark-jooq-hibernate-jdbc,代码行数:24,代码来源:CustomGeneratorStrategy.java
示例3: convertExpressionList
import org.jooq.tools.StringUtils; //导入依赖的package包/类
/**
* Generates a serial number and signature, and adds them to the list of expressions
*/
private void convertExpressionList(List<Expression> expressions) {
// Obtain the data bytes
final List<String> data = expressions.stream()
.map(expression -> {
// Get rid of those pesky quotes
if (expression instanceof StringValue) {
return ((StringValue) expression).getValue();
}
return expression.toString();
})
.collect(Collectors.toList());
final String dataString = StringUtils.join(data.toArray());
final byte[] dataBytes = dataString.getBytes(Charsets.UTF_8);
DataConverter converter = new DataConverter(dataBytes, codeGen, icrl);
// Add base64 representation of signature to store it in the query properly
final String signatureString = Convert.toBase64(converter.getSignature());
expressions.add(new HexValue("from_base64('" + signatureString + "')"));
// Add serial number to expression list
Long serial = converter.getSerial();
expressions.add(new DoubleValue(serial.toString()));
}
开发者ID:Hyperparticle,项目名称:integrity-coded-database,代码行数:29,代码来源:OCTQuery.java
示例4: updateBestTopics
import org.jooq.tools.StringUtils; //导入依赖的package包/类
private void updateBestTopics() throws SQLException {
int docId = -1;
ArrayList<Integer> topicList = new ArrayList<Integer>();
Statement updateStmt = database.getConnection().createStatement();
ResultSet fulltextRS = database.executeQuery("SELECT DOCUMENT_ID,TOPIC_ID FROM DOCUMENT_TOPIC ORDER BY DOCUMENT_ID, PR_TOPIC_GIVEN_DOCUMENT DESC");
while(fulltextRS.next()) {
if(docId != fulltextRS.getInt("DOCUMENT_ID")) {
if(!topicList.isEmpty()) {
updateStmt.executeUpdate("UPDATE " + this.tableName + " SET BEST_TOPICS='"
+ StringUtils.join(topicList.toArray(), ",") + "' WHERE DOCUMENT_ID=" + docId);
}
topicList = new ArrayList<Integer>();
docId = fulltextRS.getInt("DOCUMENT_ID");
documentList.add(docId);
} else {
topicList.add(fulltextRS.getInt("TOPIC_ID"));
}
}
updateStmt.executeUpdate("UPDATE " + this.tableName + " SET BEST_TOPICS='"
+ StringUtils.join(topicList.toArray(), ",") + "' WHERE DOCUMENT_ID=" + docId);
}
开发者ID:hinneburg,项目名称:TopicExplorer,代码行数:23,代码来源:DocumentUpdate.java
示例5: hostHasContainerLabel
import org.jooq.tools.StringUtils; //导入依赖的package包/类
@Override
public boolean hostHasContainerLabel(Long hostId, String labelKey, String labelValue) {
List<? extends Instance> instances = instanceDao.getNonRemovedInstanceOn(hostId);
boolean found = false;
for (Instance instance : instances) {
Map<String, Object> labels = DataAccessor.fieldMapRO(instance, InstanceConstants.FIELD_LABELS);
Map<String, Object> labelsLowerCased = new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER);
labelsLowerCased.putAll(labels);
if (labelsLowerCased.containsKey(labelKey)) {
Object value = labelsLowerCased.get(labelKey);
if (value == null) {
continue;
}
if (StringUtils.equals(labelValue.toLowerCase(), value.toString().toLowerCase())) {
found = true;
break;
}
}
}
return found;
}
开发者ID:rancher,项目名称:cattle,代码行数:22,代码来源:AllocationHelperImpl.java
示例6: writeDatamodel
import org.jooq.tools.StringUtils; //导入依赖的package包/类
private void writeDatamodel(@NotNull final Iterable<EcrfDatamodelField> datamodelFields,
@NotNull final Supplier<InsertValuesStep4> inserter) {
context.batch(StreamSupport.stream(datamodelFields.spliterator(), false).map(field -> {
final String codeList = StringUtils.join(field.codeList().values().toArray(), ",");
//noinspection unchecked
return inserter.get().values(field.name(), field.description(), codeList, field.isRelevant() ? "TRUE" : "FALSE");
}).collect(Collectors.toList())).execute();
}
开发者ID:hartwigmedical,项目名称:hmftools,代码行数:9,代码来源:EcrfDAO.java
示例7: convertLineOCT
import org.jooq.tools.StringUtils; //导入依赖的package包/类
private Stream<List<String>> convertLineOCT(Stream<List<String>> csvInput) throws IOException {
return csvInput.map(line -> {
// Combine the list into a string
final String data = StringUtils.join(line.toArray());
final byte[] dataBytes = data.getBytes(Charsets.UTF_8);
convertLine(line, dataBytes, codeGen, icrl);
return line;
});
}
开发者ID:Hyperparticle,项目名称:integrity-coded-database,代码行数:11,代码来源:FileConverter.java
示例8: evaluateMacros
import org.jooq.tools.StringUtils; //导入依赖的package包/类
private String evaluateMacros(String valueStr, Instance instance) {
if (valueStr.contains(SERVICE_NAME_MACRO) ||
valueStr.contains(STACK_NAME_MACRO)) {
Map<String, String> labels = DataAccessor.getLabels(instance);
String serviceLaunchConfigName = "";
String stackName = "";
if (labels != null && !labels.isEmpty()) {
for (Map.Entry<String, String> label : labels.entrySet()) {
String value = label.getValue();
if (SystemLabels.LABEL_STACK_NAME.equals(label.getKey())) {
stackName = value;
} else if (SystemLabels.LABEL_STACK_SERVICE_NAME.equals(label.getKey())) {
if (value != null) {
int i = value.indexOf('/');
if (i != -1) {
serviceLaunchConfigName = value.substring(i + 1);
}
}
}
}
}
if (!StringUtils.isBlank(stackName)) {
valueStr = valueStr.replace(STACK_NAME_MACRO, stackName);
}
if (!StringUtils.isBlank(serviceLaunchConfigName)) {
valueStr = valueStr.replace(SERVICE_NAME_MACRO, serviceLaunchConfigName);
}
}
return valueStr;
}
开发者ID:rancher,项目名称:cattle,代码行数:34,代码来源:AllocationHelperImpl.java
示例9: serialize
import org.jooq.tools.StringUtils; //导入依赖的package包/类
@Override
public void serialize(Record record, JsonGenerator jgen,
SerializerProvider provider) throws IOException,
JsonProcessingException {
for (Field<?> field : record.fields()) {
Object value = record.getValue(field);
if (value != null) {
jgen.writeFieldName(StringUtils.toCamelCaseLC(field.getName()));
jgen.writeObject(value);
}
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:13,代码来源:RecordSerializer.java
示例10: readEnsemblQuery
import org.jooq.tools.StringUtils; //导入依赖的package包/类
@NotNull
private static String readEnsemblQuery() throws IOException {
final List<String> lines = Resources.readLines(Resources.getResource("ensembl_query.sql"), Charset.defaultCharset());
return StringUtils.join(lines.toArray(), "\n");
}
开发者ID:hartwigmedical,项目名称:hmftools,代码行数:6,代码来源:HmfGenePanelBuilder.java
示例11: getSQLPart
import org.jooq.tools.StringUtils; //导入依赖的package包/类
private String getSQLPart(ArrayList<String> part, String glue) {
return StringUtils.join(part.toArray(new String[part.size()]), glue);
}
开发者ID:hinneburg,项目名称:TopicExplorer,代码行数:4,代码来源:SelectMap.java
注:本文中的org.jooq.tools.StringUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论