gpt4 book ai didi

org.mozilla.zest.core.v1.ZestExpressionStatusCode.getCode()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:36:45 26 4
gpt4 key购买 nike

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

ZestExpressionStatusCode.getCode介绍

[英]Gets the code.
[中]获取代码。

代码示例

代码示例来源:origin: mozilla/zest

@Test
public void shouldHaveZeroStatusCodeByDefault() {
  // Given / When
  ZestExpressionStatusCode statusCodeExpression = new ZestExpressionStatusCode();
  // Then
  assertEquals(statusCodeExpression.getCode(), 0);
}

代码示例来源:origin: mozilla/zest

} else if (element instanceof ZestExpressionStatusCode) {
  ZestExpressionStatusCode codeExpr = (ZestExpressionStatusCode) element;
  System.out.print("Status Code: " + codeExpr.getCode());
} else if (element instanceof ZestExpressionIsInteger) {
  ZestExpressionIsInteger codeExpr = (ZestExpressionIsInteger) element;

代码示例来源:origin: mozilla/zest

@Test
public void shouldSetStatusCode() {
  // Given
  int statusCode = 201;
  ZestExpressionStatusCode statusCodeExpression = new ZestExpressionStatusCode();
  // When
  statusCodeExpression.setCode(statusCode);
  // Then
  assertEquals(statusCode, statusCodeExpression.getCode());
}

代码示例来源:origin: mozilla/zest

@Test
public void shouldDeepCopy() {
  // Given
  ZestExpressionStatusCode statusCodeExpression = new ZestExpressionStatusCode(404);
  statusCodeExpression.setInverse(true);
  // When
  ZestExpressionStatusCode copyStatusCodeExpression = statusCodeExpression.deepCopy();
  // Then
  assertTrue(copyStatusCodeExpression != statusCodeExpression);
  assertEquals(copyStatusCodeExpression.getCode(), statusCodeExpression.getCode());
  assertEquals(copyStatusCodeExpression.isInverse(), statusCodeExpression.isInverse());
}

代码示例来源:origin: mozilla/zest

@Test
public void shouldSerialiseAndDeserialise() {
  // Given
  ZestExpressionStatusCode statusCodeExpression = new ZestExpressionStatusCode(401);
  // When
  String serialisation = ZestJSON.toString(statusCodeExpression);
  ZestExpressionStatusCode deserialisedStatusCodeExpression =
      (ZestExpressionStatusCode) ZestJSON.fromString(serialisation);
  // Then
  assertTrue(deserialisedStatusCodeExpression != statusCodeExpression);
  assertEquals(deserialisedStatusCodeExpression.getCode(), statusCodeExpression.getCode());
  assertEquals(
      deserialisedStatusCodeExpression.isInverse(), statusCodeExpression.isInverse());
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com