org.apache.isis.core.metamodel.adapter.version.Version.getTime()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中org.apache.isis.core.metamodel.adapter.version.Version.getTime()方法的一些代码示例,展示了Version.getTime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getTime()方法的具体详情如下:
包路径:org.apache.isis.core.metamodel.adapter.version.Version
类名称:Version
方法名:getTime

Version.getTime介绍

[英]Returns the time of the last change.
[中]返回上次更改的时间。

代码示例

代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-impl

public static ResponseBuilder addLastModifiedAndETagIfAvailable(final ResponseBuilder responseBuilder, final Version version) {
  if (version != null && version.getTime() != null) {
    final Date time = version.getTime();
    responseBuilder.lastModified(time);
    responseBuilder.tag("" + time);
  }
  return responseBuilder;
}

代码示例来源:origin: org.apache.isis.core/isis-core-viewer-restfulobjects-rendering

public static Response.ResponseBuilder addLastModifiedAndETagIfAvailable(
    final Response.ResponseBuilder responseBuilder,
    final Version version) {
  if (version != null && version.getTime() != null) {
    final Date time = version.getTime();
    responseBuilder.lastModified(time);
    responseBuilder.tag(asETag(time));
  }
  return responseBuilder;
}

代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-server

public static ResponseBuilder addLastModifiedAndETagIfAvailable(final ResponseBuilder responseBuilder, final Version version) {
  if (version != null && version.getTime() != null) {
    final Date time = version.getTime();
    responseBuilder.lastModified(time);
    responseBuilder.tag(asETag(time));
  }
  return responseBuilder;
}

代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-server

public Response objectRepresentation() {
  final DomainObjectReprRenderer renderer = new DomainObjectReprRenderer(resourceContext, null, JsonRepresentation.newMap());
  renderer.with(objectAdapter).includesSelf();
  final ResponseBuilder respBuilder = ResourceAbstract.responseOfOk(renderer, Caching.NONE);
  final Version version = objectAdapter.getVersion();
  if (version != null && version.getTime() != null) {
    respBuilder.tag(ETAG_FORMAT.format(version.getTime()));
  }
  return respBuilder.build();
}

代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-impl

public Response objectRepresentation() {
  final RendererFactory rendererFactory = getRendererFactoryRegistry().find(RepresentationType.DOMAIN_OBJECT);
  final DomainObjectReprRenderer renderer = (DomainObjectReprRenderer) rendererFactory.newRenderer(resourceContext, null, JsonRepresentation.newMap());
  renderer.with(objectAdapter).includesSelf();
  final ResponseBuilder respBuilder = ResourceAbstract.responseOfOk(renderer, Caching.NONE);
  final Version version = objectAdapter.getVersion();
  if (version != null && version.getTime() != null) {
    respBuilder.tag(ETAG_FORMAT.format(version.getTime()));
  }
  return respBuilder.build();
}

代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime

public ConcurrencyException(final ObjectAdapter object, final Version updated) {
  this(object.getVersion().getUser() + " changed " + object.titleString() + " at " + DateFormat.getDateTimeInstance().format(object.getVersion().getTime()) + "\n\n" + object.getVersion() + " ~ " + updated + "", object.getOid());
}

代码示例来源:origin: org.apache.isis.core/isis-core-viewer-restfulobjects-rendering

/**
 * Not API
 */
ResponseBuilder buildResponseTo(
    final RepresentationService.Context2 rendererContext,
    final ObjectAdapter objectAdapter,
    final JsonRepresentation representationIfAnyRequired,
    final JsonRepresentation rootRepresentation) {
  final DomainObjectReprRenderer renderer =
      new DomainObjectReprRenderer(rendererContext, null, representationIfAnyRequired);
  renderer.with(objectAdapter).includesSelf();
  final ResponseBuilder responseBuilder = Responses.ofOk(renderer, Caching.NONE, rootRepresentation);
  if(rendererContext instanceof RepresentationService.Context6) {
    final RepresentationService.Context6 context6 = (RepresentationService.Context6) rendererContext;
    final RepresentationService.Intent intent = context6.getIntent();
    if(intent == RepresentationService.Intent.JUST_CREATED) {
      responseBuilder.status(Response.Status.CREATED);
    }
  }
  final Version version = objectAdapter.getVersion();
  if (version != null && version.getTime() != null) {
    responseBuilder.tag(etagFormat().format(version.getTime()));
  }
  return responseBuilder;
}

代码示例来源:origin: org.apache.isis.core/isis-core-plugins-jdo-datanucleus-5

private void allowUnimportantMethodCallsOn(final Version version) {
  context.checking(new Expectations() {
    {
      allowing(version).getSequence();
      allowing(version).getUtcTimestamp();
      allowing(version).sequence();
      allowing(version).getUser();
      allowing(version).hasTimestamp();
      
      allowing(version).getTime();
      will(returnValue(new Date()));
      
      allowing(mockAuthenticationSession).getUserName();
      will(returnValue("fredbloggs"));
    }
  });
}

相关文章