本文整理汇总了Java中com.belladati.sdk.intervals.TimeUnit类的典型用法代码示例。如果您正苦于以下问题:Java TimeUnit类的具体用法?Java TimeUnit怎么用?Java TimeUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimeUnit类属于com.belladati.sdk.intervals包,在下文中一共展示了TimeUnit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: queryStringTimeOnly
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** Query parameters with time only are correct. */
public void queryStringTimeOnly() throws UnknownViewTypeException {
final ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR));
final ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR));
server.register(viewsUri, new TestRequestHandler() {
@Override
protected void handle(HttpHolder holder) throws IOException {
String intervalString = holder.getUrlParameters().get("dateTimeDefinition");
assertNotNull(intervalString);
ObjectNode intervalNode = buildIntervalNode(TimeUnit.HOUR, from, to, "absolute");
assertEquals(mapper.readTree(intervalString), intervalNode);
holder.response.setEntity(new StringEntity("{}"));
}
});
getService().setupViewLoader(viewId, ViewType.CHART).setTimeInterval(new AbsoluteInterval<TimeUnit>(TimeUnit.HOUR, start, end))
.loadContent();
server.assertRequestUris(viewsUri);
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:22,代码来源:IntervalTest.java
示例2: queryStringBoth
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** Query parameters with both intervals are correct. */
public void queryStringBoth() throws UnknownViewTypeException {
final ObjectNode from = mapper.createObjectNode().put("year", start.get(Calendar.YEAR));
final ObjectNode to = mapper.createObjectNode().put("year", end.get(Calendar.YEAR));
server.register(viewsUri, new TestRequestHandler() {
@Override
protected void handle(HttpHolder holder) throws IOException {
String intervalString = holder.getUrlParameters().get("dateTimeDefinition");
assertNotNull(intervalString);
ObjectNode intervalNode = buildIntervalNode(DateUnit.YEAR, from, to, "absolute");
intervalNode.setAll(buildIntervalNode(TimeUnit.MINUTE, new IntNode(-10), new IntNode(10), "relative"));
assertEquals(mapper.readTree(intervalString), intervalNode);
holder.response.setEntity(new StringEntity("{}"));
}
});
getService().setupViewLoader(viewId, ViewType.CHART).setDateInterval(new AbsoluteInterval<DateUnit>(DateUnit.YEAR, start, end))
.setTimeInterval(new RelativeInterval<TimeUnit>(TimeUnit.MINUTE, -10, 10)).loadContent();
server.assertRequestUris(viewsUri);
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:23,代码来源:IntervalTest.java
示例3: predefinedSecondInterval
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** absolute time interval in seconds */
public void predefinedSecondInterval() throws UnknownViewTypeException {
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR))
.put("minute", start.get(Calendar.MINUTE)).put("second", start.get(Calendar.SECOND));
ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR)).put("minute", end.get(Calendar.MINUTE))
.put("second", end.get(Calendar.SECOND));
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
viewNode.put("dateTimeDefinition", buildIntervalNode(TimeUnit.SECOND, from, to, "absolute"));
View view = ViewImpl.buildView(getService(), viewNode);
Calendar expectedStart = new GregorianCalendar(0, 0, 0, start.get(Calendar.HOUR), start.get(Calendar.MINUTE),
start.get(Calendar.SECOND));
Calendar expectedEnd = new GregorianCalendar(0, 0, 0, end.get(Calendar.HOUR), end.get(Calendar.MINUTE),
end.get(Calendar.SECOND));
assertFalse(view.hasPredefinedDateInterval());
assertTrue(view.hasPredefinedTimeInterval());
assertNull(view.getPredefinedDateInterval());
AbsoluteInterval<TimeUnit> interval = (AbsoluteInterval<TimeUnit>) view.getPredefinedTimeInterval();
assertEquals(interval.getIntervalUnit(), TimeUnit.SECOND);
assertEquals(interval.getStart(), expectedStart);
assertEquals(interval.getEnd(), expectedEnd);
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:25,代码来源:IntervalTest.java
示例4: predefinedMinuteInterval
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** absolute time interval in minutes */
public void predefinedMinuteInterval() throws UnknownViewTypeException {
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR)).put("minute",
start.get(Calendar.MINUTE));
ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR)).put("minute", end.get(Calendar.MINUTE));
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
viewNode.put("dateTimeDefinition", buildIntervalNode(TimeUnit.MINUTE, from, to, "absolute"));
View view = ViewImpl.buildView(getService(), viewNode);
Calendar expectedStart = new GregorianCalendar(0, 0, 0, start.get(Calendar.HOUR), start.get(Calendar.MINUTE), 0);
Calendar expectedEnd = new GregorianCalendar(0, 0, 0, end.get(Calendar.HOUR), end.get(Calendar.MINUTE), 0);
assertFalse(view.hasPredefinedDateInterval());
assertTrue(view.hasPredefinedTimeInterval());
assertNull(view.getPredefinedDateInterval());
AbsoluteInterval<TimeUnit> interval = (AbsoluteInterval<TimeUnit>) view.getPredefinedTimeInterval();
assertEquals(interval.getIntervalUnit(), TimeUnit.MINUTE);
assertEquals(interval.getStart(), expectedStart);
assertEquals(interval.getEnd(), expectedEnd);
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:22,代码来源:IntervalTest.java
示例5: predefinedHourInterval
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** absolute time interval in hours */
public void predefinedHourInterval() throws UnknownViewTypeException {
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR));
ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR));
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
viewNode.put("dateTimeDefinition", buildIntervalNode(TimeUnit.HOUR, from, to, "absolute"));
View view = ViewImpl.buildView(getService(), viewNode);
Calendar expectedStart = new GregorianCalendar(0, 0, 0, start.get(Calendar.HOUR), 0, 0);
Calendar expectedEnd = new GregorianCalendar(0, 0, 0, end.get(Calendar.HOUR), 0, 0);
assertFalse(view.hasPredefinedDateInterval());
assertTrue(view.hasPredefinedTimeInterval());
assertNull(view.getPredefinedDateInterval());
AbsoluteInterval<TimeUnit> interval = (AbsoluteInterval<TimeUnit>) view.getPredefinedTimeInterval();
assertEquals(interval.getIntervalUnit(), TimeUnit.HOUR);
assertEquals(interval.getStart(), expectedStart);
assertEquals(interval.getEnd(), expectedEnd);
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:21,代码来源:IntervalTest.java
示例6: queryStringTimeOnly
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** Query parameters with time only are correct. */
public void queryStringTimeOnly() throws UnknownViewTypeException {
final ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR));
final ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR));
server.register(viewsUri, new TestRequestHandler() {
@Override
protected void handle(HttpHolder holder) throws IOException {
String intervalString = holder.getUrlParameters().get("dateTimeDefinition");
assertNotNull(intervalString);
ObjectNode intervalNode = buildIntervalNode(TimeUnit.HOUR, from, to, "absolute");
assertEquals(mapper.readTree(intervalString), intervalNode);
holder.response.setEntity(new StringEntity("{}"));
}
});
service.createViewLoader(viewId, ViewType.CHART)
.setTimeInterval(new AbsoluteInterval<TimeUnit>(TimeUnit.HOUR, start, end)).loadContent();
server.assertRequestUris(viewsUri);
}
开发者ID:BellaDati,项目名称:belladati-sdk-android,代码行数:22,代码来源:IntervalTest.java
示例7: queryStringBoth
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** Query parameters with both intervals are correct. */
public void queryStringBoth() throws UnknownViewTypeException {
final ObjectNode from = mapper.createObjectNode().put("year", start.get(Calendar.YEAR));
final ObjectNode to = mapper.createObjectNode().put("year", end.get(Calendar.YEAR));
server.register(viewsUri, new TestRequestHandler() {
@Override
protected void handle(HttpHolder holder) throws IOException {
String intervalString = holder.getUrlParameters().get("dateTimeDefinition");
assertNotNull(intervalString);
ObjectNode intervalNode = buildIntervalNode(DateUnit.YEAR, from, to, "absolute");
intervalNode.setAll(buildIntervalNode(TimeUnit.MINUTE, new IntNode(-10), new IntNode(10), "relative"));
assertEquals(mapper.readTree(intervalString), intervalNode);
holder.response.setEntity(new StringEntity("{}"));
}
});
service.createViewLoader(viewId, ViewType.CHART)
.setDateInterval(new AbsoluteInterval<DateUnit>(DateUnit.YEAR, start, end))
.setTimeInterval(new RelativeInterval<TimeUnit>(TimeUnit.MINUTE, -10, 10)).loadContent();
server.assertRequestUris(viewsUri);
}
开发者ID:BellaDati,项目名称:belladati-sdk-android,代码行数:24,代码来源:IntervalTest.java
示例8: predefinedSecondInterval
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** absolute time interval in seconds */
public void predefinedSecondInterval() throws UnknownViewTypeException {
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR))
.put("minute", start.get(Calendar.MINUTE)).put("second", start.get(Calendar.SECOND));
ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR)).put("minute", end.get(Calendar.MINUTE))
.put("second", end.get(Calendar.SECOND));
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
viewNode.put("dateTimeDefinition", buildIntervalNode(TimeUnit.SECOND, from, to, "absolute"));
View view = ViewImpl.buildView(service, viewNode);
Calendar expectedStart = new GregorianCalendar(0, 0, 0, start.get(Calendar.HOUR), start.get(Calendar.MINUTE),
start.get(Calendar.SECOND));
Calendar expectedEnd = new GregorianCalendar(0, 0, 0, end.get(Calendar.HOUR), end.get(Calendar.MINUTE),
end.get(Calendar.SECOND));
assertFalse(view.hasPredefinedDateInterval());
assertTrue(view.hasPredefinedTimeInterval());
assertNull(view.getPredefinedDateInterval());
AbsoluteInterval<TimeUnit> interval = (AbsoluteInterval<TimeUnit>) view.getPredefinedTimeInterval();
assertEquals(interval.getIntervalUnit(), TimeUnit.SECOND);
assertEquals(interval.getStart(), expectedStart);
assertEquals(interval.getEnd(), expectedEnd);
}
开发者ID:BellaDati,项目名称:belladati-sdk-android,代码行数:25,代码来源:IntervalTest.java
示例9: predefinedMinuteInterval
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** absolute time interval in minutes */
public void predefinedMinuteInterval() throws UnknownViewTypeException {
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR))
.put("minute", start.get(Calendar.MINUTE));
ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR)).put("minute", end.get(Calendar.MINUTE));
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
viewNode.put("dateTimeDefinition", buildIntervalNode(TimeUnit.MINUTE, from, to, "absolute"));
View view = ViewImpl.buildView(service, viewNode);
Calendar expectedStart = new GregorianCalendar(0, 0, 0, start.get(Calendar.HOUR), start.get(Calendar.MINUTE), 0);
Calendar expectedEnd = new GregorianCalendar(0, 0, 0, end.get(Calendar.HOUR), end.get(Calendar.MINUTE), 0);
assertFalse(view.hasPredefinedDateInterval());
assertTrue(view.hasPredefinedTimeInterval());
assertNull(view.getPredefinedDateInterval());
AbsoluteInterval<TimeUnit> interval = (AbsoluteInterval<TimeUnit>) view.getPredefinedTimeInterval();
assertEquals(interval.getIntervalUnit(), TimeUnit.MINUTE);
assertEquals(interval.getStart(), expectedStart);
assertEquals(interval.getEnd(), expectedEnd);
}
开发者ID:BellaDati,项目名称:belladati-sdk-android,代码行数:22,代码来源:IntervalTest.java
示例10: predefinedHourInterval
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** absolute time interval in hours */
public void predefinedHourInterval() throws UnknownViewTypeException {
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR));
ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR));
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
viewNode.put("dateTimeDefinition", buildIntervalNode(TimeUnit.HOUR, from, to, "absolute"));
View view = ViewImpl.buildView(service, viewNode);
Calendar expectedStart = new GregorianCalendar(0, 0, 0, start.get(Calendar.HOUR), 0, 0);
Calendar expectedEnd = new GregorianCalendar(0, 0, 0, end.get(Calendar.HOUR), 0, 0);
assertFalse(view.hasPredefinedDateInterval());
assertTrue(view.hasPredefinedTimeInterval());
assertNull(view.getPredefinedDateInterval());
AbsoluteInterval<TimeUnit> interval = (AbsoluteInterval<TimeUnit>) view.getPredefinedTimeInterval();
assertEquals(interval.getIntervalUnit(), TimeUnit.HOUR);
assertEquals(interval.getStart(), expectedStart);
assertEquals(interval.getEnd(), expectedEnd);
}
开发者ID:BellaDati,项目名称:belladati-sdk-android,代码行数:21,代码来源:IntervalTest.java
示例11: appendDateTime
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/**
* Appends a date/time definition parameter to the URI builder. Won't do
* anything if both intervals are <tt>null</tt>.
*
* @param builder the builder to append to
* @param dateInterval date interval to append, or <tt>null</tt>
* @param timeInterval time interval to append, or <tt>null</tt>
* @return the same builder, for chaining
*/
public URIBuilder appendDateTime(URIBuilder builder, Interval<DateUnit> dateInterval, Interval<TimeUnit> timeInterval) {
if (dateInterval != null || timeInterval != null) {
ObjectNode dateTimeNode = new ObjectMapper().createObjectNode();
if (dateInterval != null) {
dateTimeNode.setAll(dateInterval.toJson());
}
if (timeInterval != null) {
dateTimeNode.setAll(timeInterval.toJson());
}
builder.addParameter("dateTimeDefinition", dateTimeNode.toString());
}
return builder;
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:23,代码来源:BellaDatiServiceImpl.java
示例12: absoluteSecondsToJson
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** absolute time interval down to seconds */
public void absoluteSecondsToJson() {
Interval<?> interval = new AbsoluteInterval<IntervalUnit>(TimeUnit.SECOND, start, end);
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR))
.put("minute", start.get(Calendar.MINUTE)).put("second", start.get(Calendar.SECOND));
ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR)).put("minute", end.get(Calendar.MINUTE))
.put("second", end.get(Calendar.SECOND));
JsonNode expectedJson = buildIntervalNode(TimeUnit.SECOND, from, to, "absolute");
assertEquals(interval.toJson(), expectedJson);
assertEquals(interval.toString(), expectedJson.toString());
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:15,代码来源:IntervalTest.java
示例13: absoluteMinutesToJson
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** absolute time interval down to minutes */
public void absoluteMinutesToJson() {
Interval<?> interval = new AbsoluteInterval<IntervalUnit>(TimeUnit.MINUTE, start, end);
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR)).put("minute",
start.get(Calendar.MINUTE));
ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR)).put("minute", end.get(Calendar.MINUTE));
JsonNode expectedJson = buildIntervalNode(TimeUnit.MINUTE, from, to, "absolute");
assertEquals(interval.toJson(), expectedJson);
assertEquals(interval.toString(), expectedJson.toString());
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:14,代码来源:IntervalTest.java
示例14: absoluteHoursToJson
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** absolute time interval down to hours */
public void absoluteHoursToJson() {
Interval<?> interval = new AbsoluteInterval<IntervalUnit>(TimeUnit.HOUR, start, end);
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR));
ObjectNode to = mapper.createObjectNode().put("hour", end.get(Calendar.HOUR));
JsonNode expectedJson = buildIntervalNode(TimeUnit.HOUR, from, to, "absolute");
assertEquals(interval.toJson(), expectedJson);
assertEquals(interval.toString(), expectedJson.toString());
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:13,代码来源:IntervalTest.java
示例15: startEndEqualAbsolute
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** start and end may be equal in absolute intervals */
public void startEndEqualAbsolute() {
Interval<?> interval = new AbsoluteInterval<IntervalUnit>(TimeUnit.HOUR, start, start);
ObjectNode from = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR));
ObjectNode to = mapper.createObjectNode().put("hour", start.get(Calendar.HOUR));
JsonNode expectedJson = buildIntervalNode(TimeUnit.HOUR, from, to, "absolute");
assertEquals(interval.toJson(), expectedJson);
assertEquals(interval.toString(), expectedJson.toString());
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:13,代码来源:IntervalTest.java
示例16: startAfterEndAbsolute
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** start may not be later than end in absolute intervals */
public void startAfterEndAbsolute() {
try {
new AbsoluteInterval<IntervalUnit>(TimeUnit.HOUR, end, start);
fail("did not throw exception");
} catch (InvalidAbsoluteIntervalException e) {
assertEquals(e.getIntervalUnit(), TimeUnit.HOUR);
assertEquals(e.getStart(), end);
assertEquals(e.getEnd(), start);
}
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:12,代码来源:IntervalTest.java
示例17: invalidUnits
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** intervals with invalid units are ignored */
public void invalidUnits() throws UnknownViewTypeException {
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
ObjectNode definitionNode = buildIntervalNode(DateUnit.DAY, new TextNode("-3"), new IntNode(3), "relative");
definitionNode.setAll(buildIntervalNode(TimeUnit.HOUR, new TextNode("-3"), new IntNode(3), "relative"));
((ObjectNode) definitionNode.get("dateInterval")).put("aggregationType", "not a date unit");
((ObjectNode) definitionNode.get("timeInterval")).put("aggregationType", "not a time unit");
viewNode.put("dateTimeDefinition", definitionNode);
View view = ViewImpl.buildView(getService(), viewNode);
assertFalse(view.hasPredefinedDateInterval());
assertFalse(view.hasPredefinedTimeInterval());
assertNull(view.getPredefinedDateInterval());
assertNull(view.getPredefinedTimeInterval());
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:16,代码来源:IntervalTest.java
示例18: noUnits
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** intervals with null units are ignored */
public void noUnits() throws UnknownViewTypeException {
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
ObjectNode definitionNode = buildIntervalNode(DateUnit.DAY, new TextNode("-3"), new IntNode(3), "relative");
definitionNode.setAll(buildIntervalNode(TimeUnit.HOUR, new TextNode("-3"), new IntNode(3), "relative"));
((ObjectNode) definitionNode.get("dateInterval")).remove("aggregationType");
((ObjectNode) definitionNode.get("timeInterval")).remove("aggregationType");
viewNode.put("dateTimeDefinition", definitionNode);
View view = ViewImpl.buildView(getService(), viewNode);
assertFalse(view.hasPredefinedDateInterval());
assertFalse(view.hasPredefinedTimeInterval());
assertNull(view.getPredefinedDateInterval());
assertNull(view.getPredefinedTimeInterval());
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:16,代码来源:IntervalTest.java
示例19: startAfterEnd
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** intervals with start after end are ignored */
public void startAfterEnd() throws UnknownViewTypeException {
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
ObjectNode definitionNode = buildIntervalNode(DateUnit.DAY, new IntNode(3), new IntNode(-3), "relative");
definitionNode.setAll(buildIntervalNode(TimeUnit.HOUR, new IntNode(3), new IntNode(-3), "relative"));
viewNode.put("dateTimeDefinition", definitionNode);
View view = ViewImpl.buildView(getService(), viewNode);
assertFalse(view.hasPredefinedDateInterval());
assertFalse(view.hasPredefinedTimeInterval());
assertNull(view.getPredefinedDateInterval());
assertNull(view.getPredefinedTimeInterval());
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:14,代码来源:IntervalTest.java
示例20: unitCaseInsensitive
import com.belladati.sdk.intervals.TimeUnit; //导入依赖的package包/类
/** interval units are not case-sensitive */
public void unitCaseInsensitive() throws UnknownViewTypeException {
ObjectNode viewNode = builder.buildViewNode(viewId, viewName, "chart");
ObjectNode definitionNode = buildIntervalNode(DateUnit.DAY, new TextNode("-3"), new IntNode(3), "relative");
definitionNode.setAll(buildIntervalNode(TimeUnit.HOUR, new TextNode("-3"), new IntNode(3), "relative"));
((ObjectNode) definitionNode.get("dateInterval")).put("aggregationType", "dAy");
((ObjectNode) definitionNode.get("timeInterval")).put("aggregationType", "hOuR");
viewNode.put("dateTimeDefinition", definitionNode);
View view = ViewImpl.buildView(getService(), viewNode);
assertTrue(view.hasPredefinedDateInterval());
assertTrue(view.hasPredefinedTimeInterval());
}
开发者ID:BellaDati,项目名称:belladati-sdk-java,代码行数:14,代码来源:IntervalTest.java
注:本文中的com.belladati.sdk.intervals.TimeUnit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论