当前位置: 首页>>代码示例>>Java>>正文


Java LocalDate.toString方法代码示例

本文整理汇总了Java中java.time.LocalDate.toString方法的典型用法代码示例。如果您正苦于以下问题:Java LocalDate.toString方法的具体用法?Java LocalDate.toString怎么用?Java LocalDate.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.time.LocalDate的用法示例。


在下文中一共展示了LocalDate.toString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getServerStatus

import java.time.LocalDate; //导入方法依赖的package包/类
@RequestMapping("/getServerStatus")
public ServerStatusBean getServerStatus()
{
  String statusMsg;
  List<Long> allDates = zwbAggregateCorpWorker.getAllDates();
  Set<String> allMonth = allDates.stream()
    .map(Object::toString)
    .map(dateAsString -> dateAsString.substring(0, 6))
    .collect(Collectors.toCollection(LinkedHashSet::new));

  LocalDate firstProcessedDate = longToLocalDate(allDates.get(0));
  LocalDate latestProcessedDate = longToLocalDate(allDates.get(allDates.size() - 1));
  LocalDate today = LocalDate.now();
  Long daysMissing = Stream.iterate(firstProcessedDate, date -> date.plusDays(1))
    .limit(ChronoUnit.DAYS.between(firstProcessedDate, today) + 1)
    .filter(date -> !allDates.contains(localDateToLong(date)))
    .count();

  statusMsg = "data until " + latestProcessedDate.toString() + ", " + daysMissing.toString() + (daysMissing == 1 ? " day" : " days") + " missing, ødb: " +
              String.format("%.2f", responseTime.getDbMillis()) + " ms, øagg: " + String.format("%.2f", responseTime.getAggMillis()) + " ms";

  return new ServerStatusBean(new ArrayList<>(allMonth), statusMsg);
}
 
开发者ID:fetox74,项目名称:wormboard-backend,代码行数:24,代码来源:StatisticAggregatesController.java

示例2: encodeText

import java.time.LocalDate; //导入方法依赖的package包/类
@Override
public final String encodeText(final LocalDate value) {
  return value.toString();
}
 
开发者ID:traneio,项目名称:ndbc,代码行数:5,代码来源:LocalDateEncoding.java

示例3: marshal

import java.time.LocalDate; //导入方法依赖的package包/类
@Override
public String marshal(LocalDate date)
{
    return date.toString();
}
 
开发者ID:a-schild,项目名称:nextcloud-java-api,代码行数:6,代码来源:LocalDateXmlAdapter.java

示例4: marshal

import java.time.LocalDate; //导入方法依赖的package包/类
@Nullable
@Override
public String marshal(LocalDate v) {
	return v == null ? null : v.toString();
}
 
开发者ID:dvbern,项目名称:date-helper,代码行数:6,代码来源:LocalDateXMLConverter.java

示例5: test_toString

import java.time.LocalDate; //导入方法依赖的package包/类
@Test(dataProvider="sampleToString")
public void test_toString(int y, int m, int d, String expected) {
    LocalDate t = LocalDate.of(y, m, d);
    String str = t.toString();
    assertEquals(str, expected);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:TCKLocalDate.java

示例6: getDayWeekYear

import java.time.LocalDate; //导入方法依赖的package包/类
private String getDayWeekYear(LocalDate date) {
    String dateString = date.toString();
    String[] dateArr = dateString.split("-");
    return dateArr[2] + "/" + dateArr[1] + "/" + dateArr[0].substring(2, 4);
}
 
开发者ID:ericywl,项目名称:InfoSys-1D,代码行数:6,代码来源:BookingSlot.java

示例7: write

import java.time.LocalDate; //导入方法依赖的package包/类
@Override
public String write(LocalDate instant) throws Exception {
    return instant.toString();
}
 
开发者ID:adleritech,项目名称:flexibee,代码行数:5,代码来源:LocalDateTransform.java

示例8: createRootElement

import java.time.LocalDate; //导入方法依赖的package包/类
private Element createRootElement() {
	Element rootElement = document.createElement("DrugResistance_Interpretation");
	rootElement.setAttributeNS(
		"http://www.w3.org/2001/XMLSchema-instance",
		"xsi:noNamespaceSchemaLocation",
		"http://hivdb.stanford.edu/DR/schema/sierra.xsd");

	// element name="algorithmName" type="xs:string"
	rootElement.appendChild(
		newSimpleElement("algorithmName", ALG_NAME));

	// name="algorithmVersion" type="xs:string"
	rootElement.appendChild(
		newSimpleElement("algorithmVersion", ALG_VERSION));

	// algorithmDate is not in schema
	// rootElement.appendChild(
	// 	newSimpleElement("algorithmDate", ALG_DATE));

	// name="webServiceVersion" type="xs:string"
	rootElement.appendChild(
		newSimpleElement("webServiceVersion", WEB_SERVICE_VERSION));

	// name="schemaVersion" type="xs:string"
	rootElement.appendChild(
		newSimpleElement("schemaVersion", SCHEMA_VERSION));

	// name="submissionName" type="xs:string" minOccurs="0" maxOccurs="1"
	rootElement.appendChild(
		newSimpleElement("submissionName", SUBMISSION_NAME));

	// name="dateTime" type="xs:string" minOccurs="0" maxOccurs="1"
	LocalDate today = LocalDate.now();
	LocalTime time = LocalTime.now();
	String dateTime = today.toString() + " " + time.toString();

	rootElement.appendChild(
		newSimpleElement("dateTime", dateTime));

	// name="result" type="Result" minOccurs="0" maxOccurs="unbounded"
	for (int i=0; i < alignedSequences.size(); i ++) {
		rootElement.appendChild(
			createResultElement(
				alignedSequences.get(i),
				allResistanceResults.get(i)
			)
		);
	}

	return rootElement;
}
 
开发者ID:hivdb,项目名称:sierra,代码行数:52,代码来源:XmlOutput.java


注:本文中的java.time.LocalDate.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。