- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.orcid.jaxb.model.common_v2.Year
类的一些代码示例,展示了Year
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Year
类的具体详情如下:
包路径:org.orcid.jaxb.model.common_v2.Year
类名称:Year
[英]Java class for anonymous complex type.
The following schema fragment specifies the expected content contained within this class. *
[中]匿名复杂类型的Java类。
以下架构片段指定了该类中包含的预期内容*
代码示例来源:origin: ORCID/ORCID-Source
public static boolean isEmpty(org.orcid.jaxb.model.common_v2.Year year) {
if (year==null) return true;
return isEmpty(year.getValue());
}
代码示例来源:origin: ORCID/ORCID-Source
public static FuzzyDate valueOf(Integer year, Integer month, Integer day) {
FuzzyDate fuzzyDate = new FuzzyDate();
fuzzyDate.year = year != null ? new Year(year) : null;
fuzzyDate.month = month != null ? new Month(month) : null;
fuzzyDate.day = day != null ? new Day(day) : null;
return fuzzyDate;
}
代码示例来源:origin: ORCID/ORCID-Source
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FuzzyDate other = (FuzzyDate) obj;
if (day == null) {
if (other.day != null)
return false;
} else if (!day.equals(other.day))
return false;
if (month == null) {
if (other.month != null)
return false;
} else if (!month.equals(other.month))
return false;
if (year == null) {
if (other.year != null)
return false;
} else if (!year.equals(other.year))
return false;
return true;
}
代码示例来源:origin: ORCID/ORCID-Source
public FuzzyDate(org.orcid.jaxb.model.message.FuzzyDate other) {
if (other == null)
throw new IllegalArgumentException("Invalid init parameter");
if (other.getYear() != null) {
this.year = new Year();
this.year.setValue(other.getYear().getValue());
}
if (other.getMonth() != null) {
this.month = new Month();
this.month.setValue(other.getMonth().getValue());
}
if (other.getDay() != null) {
this.day = new Day();
this.day.setValue(other.getDay().getValue());
}
}
代码示例来源:origin: ORCID/ORCID-Source
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((day == null) ? 0 : day.hashCode());
result = prime * result + ((month == null) ? 0 : month.hashCode());
result = prime * result + ((year == null) ? 0 : year.hashCode());
return result;
}
代码示例来源:origin: ORCID/ORCID-Source
@Override
public String toString() {
StringBuilder builder = new StringBuilder(year.getValue());
if (month != null) {
builder.append("-");
builder.append(month.getValue());
}
if (day != null) {
builder.append("-");
builder.append(day.getValue());
}
return builder.toString();
}
代码示例来源:origin: ORCID/ORCID-Source
@Override
public void mapBtoA(EndDateEntity entity, FuzzyDate fuzzyDate, MappingContext context) {
if (entity.getYear() != null) {
fuzzyDate.setYear(new Year(entity.getYear()));
} else {
fuzzyDate.setYear(null);
}
if (entity.getMonth() != null) {
fuzzyDate.setMonth(new Month(entity.getMonth()));
} else {
fuzzyDate.setMonth(null);
}
if (entity.getDay() != null) {
fuzzyDate.setDay(new Day(entity.getDay()));
} else {
fuzzyDate.setDay(null);
}
}
}).register();
代码示例来源:origin: ORCID/ORCID-Source
@Override
public void mapAtoB(FuzzyDate fuzzyDate, EndDateEntity entity, MappingContext context) {
if (fuzzyDate.getYear() != null) {
entity.setYear(Integer.valueOf(fuzzyDate.getYear().getValue()));
} else {
entity.setYear(null);
}
if (fuzzyDate.getMonth() != null) {
entity.setMonth(Integer.valueOf(fuzzyDate.getMonth().getValue()));
} else {
entity.setMonth(null);
}
if (fuzzyDate.getDay() != null) {
entity.setDay(Integer.valueOf(fuzzyDate.getDay().getValue()));
} else {
entity.setDay(null);
}
}
代码示例来源:origin: ORCID/ORCID-Source
@Override
public void mapBtoA(StartDateEntity entity, FuzzyDate fuzzyDate, MappingContext context) {
if (entity.getYear() != null) {
fuzzyDate.setYear(new Year(entity.getYear()));
} else {
fuzzyDate.setYear(null);
}
if (entity.getMonth() != null) {
fuzzyDate.setMonth(new Month(entity.getMonth()));
} else {
fuzzyDate.setMonth(null);
}
if (entity.getDay() != null) {
fuzzyDate.setDay(new Day(entity.getDay()));
} else {
fuzzyDate.setDay(null);
}
}
}).register();
代码示例来源:origin: ORCID/ORCID-Source
int year = 0;
try {
year = Integer.parseInt(work.getPublicationDate().getYear().getValue());
} catch (Exception e) {
代码示例来源:origin: ORCID/ORCID-Source
@Override
public void mapAtoB(FuzzyDate fuzzyDate, StartDateEntity entity, MappingContext context) {
if (fuzzyDate.getYear() != null) {
entity.setYear(Integer.valueOf(fuzzyDate.getYear().getValue()));
} else {
entity.setYear(null);
}
if (fuzzyDate.getMonth() != null) {
entity.setMonth(Integer.valueOf(fuzzyDate.getMonth().getValue()));
} else {
entity.setMonth(null);
}
if (fuzzyDate.getDay() != null) {
entity.setDay(Integer.valueOf(fuzzyDate.getDay().getValue()));
} else {
entity.setDay(null);
}
}
代码示例来源:origin: ORCID/ORCID-Source
private String getDateString(FuzzyDate fuzzyDate) {
String year = fuzzyDate.getYear() != null ? fuzzyDate.getYear().getValue() : null;
String month = fuzzyDate.getMonth() != null ? fuzzyDate.getMonth().getValue() : null;
String day = fuzzyDate.getDay() != null ? fuzzyDate.getDay().getValue() : null;
if (day != null) {
return year + "-" + month + "-" + day;
}
if (month != null) {
return year + "-" + month;
}
if (year != null) {
return year;
}
return null;
}
}
代码示例来源:origin: ORCID/ORCID-Source
Integer.valueOf(year.getValue());
} catch (NumberFormatException n) {
Map<String, String> params = new HashMap<String, String>();
if (year.getValue().length() != 4) {
throw new OrcidValidationException("Invalid year " + year.getValue() + " please specify a four digits value");
boolean isYearEmpty = (year == null || year.getValue() == null) ? true : false;
boolean isMonthEmpty = (month == null || month.getValue() == null) ? true : false;
boolean isDayEmpty = (day == null || day.getValue() == null) ? true : false;
代码示例来源:origin: ORCID/ORCID-Source
public static String createDateSortString(org.orcid.jaxb.model.common_v2.FuzzyDate start, org.orcid.jaxb.model.common_v2.FuzzyDate end) {
String year = "0";
String month = "0";
String day = "0";
if (!isEmpty(start) && !isEmpty(start.getYear())) {
year = start.getYear().getValue();
if (!PojoUtil.isEmpty(start.getMonth()))
month = start.getMonth().getValue();
if (!PojoUtil.isEmpty(start.getDay()))
day = start.getDay().getValue();
} else if (!isEmpty(end) && !isEmpty(end.getYear())) {
year = end.getYear().getValue();
if (!PojoUtil.isEmpty(end.getMonth()))
month = end.getMonth().getValue();
if (!PojoUtil.isEmpty(end.getDay()))
day = end.getDay().getValue();
}
return year + "-" + month + '-' + day;
}
代码示例来源:origin: ORCID/ORCID-Source
if (endDate == null) {
dateSortString = "Y-";
dateSortString += startDate.getYear() == null ? "NaN" : startDate.getYear().getValue();
if (!PojoUtil.isEmpty(startDate.getMonth())) {
dateSortString += "-" + startDate.getMonth().getValue();
dateSortString += endDate.getYear() == null ? "NaN" : endDate.getYear().getValue();
if (!PojoUtil.isEmpty(endDate.getMonth())) {
dateSortString += "-" + endDate.getMonth().getValue();
dateSortString += startDate.getYear() == null ? "-NaN" : "-" + startDate.getYear().getValue();
if (!PojoUtil.isEmpty(startDate.getMonth())) {
dateSortString += "-" + startDate.getMonth().getValue();
代码示例来源:origin: ORCID/ORCID-Source
int day = 0;
try {
year = Integer.parseInt(work.getPublicationDate().getYear().getValue());
month = Integer.parseInt(work.getPublicationDate().getMonth().getValue());
day = Integer.parseInt(work.getPublicationDate().getDay().getValue());
我是一名优秀的程序员,十分优秀!