common.math.Percentage.of()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(87)

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

Percentage.of介绍

暂无

代码示例

代码示例来源:origin: warszawajug/spring-labs

@Override
public Percentage deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
    throws IOException, JsonProcessingException {
  if (jsonParser.getCurrentToken() == JsonToken.VALUE_STRING) {
    return Percentage.of(jsonParser.getValueAsString());
  }
  throw deserializationContext.mappingException("Expected percentage string!");
}

代码示例来源:origin: warszawajug/spring-labs

public static Merchant merchant() {
  return new Merchant(merchantNumber, merchantName, Percentage.of("6%"), PaybackPolicy.ALWAYS);
}

代码示例来源:origin: warszawajug/spring-labs

public static Objective objective1() {
  return new Objective("Glock", Percentage.of("50%"));
}

代码示例来源:origin: warszawajug/spring-labs

public static Objective objective2() {
  return new Objective("M60", Percentage.of("50%"));
}

代码示例来源:origin: warszawajug/spring-labs

public static Objective objective2() {
  return new Objective("M60", Percentage.of("50%"));
}

代码示例来源:origin: warszawajug/spring-labs

public static Objective objective1() {
  return new Objective("Glock", Percentage.of("50%"));
}

代码示例来源:origin: warszawajug/spring-labs

public static Objective objective2() {
  return new Objective("M60", Percentage.of("50%"));
}

代码示例来源:origin: warszawajug/spring-labs

public static Merchant merchant() {
  return new Merchant(merchantNumber, merchantName, Percentage.of("6%"), PaybackPolicy.ALWAYS);
}

代码示例来源:origin: warszawajug/spring-labs

public static Objective objective1() {
  return new Objective("Glock", Percentage.of("50%"));
}

代码示例来源:origin: warszawajug/spring-labs

public static Merchant merchant() {
  return new Merchant(merchantNumber, merchantName, Percentage.of("6%"), PaybackPolices.ALWAYS);
}

代码示例来源:origin: warszawajug/spring-labs

@Test
public void shouldWriteAndRead() throws Exception {
  TestBean bean = new TestBean("test", Percentage.of("50%"));
  String json = objectMapper.writeValueAsString(bean);
  assertThat(json).isEqualTo("{\"s\":\"test\",\"p\":\"50%\"}");
  TestBean read = objectMapper.readValue(json, TestBean.class);
  assertThat(read.getS()).isEqualTo("test");
  assertThat(read.getP()).isEqualTo(Percentage.of("50%"));
}

代码示例来源:origin: warszawajug/spring-labs

@Test
public void shouldFindMerchantByNumber() {
  Merchant merchant = repository.findByNumber("1234567890");
  assertThat(merchant).isNotNull();
  assertThat(merchant.getNumber()).isEqualTo("1234567890");
  assertThat(merchant.getName()).isEqualTo("Guns & Bombs");
  assertThat(merchant.getPayback()).isEqualTo(Percentage.of("6%"));
}

代码示例来源:origin: warszawajug/spring-labs

@Test
public void shouldFindMerchantByNumber() {
  Merchant merchant = repository.findByNumber("1234567890");
  assertThat(merchant).isNotNull();
  assertThat(merchant.getNumber()).isEqualTo("1234567890");
  assertThat(merchant.getName()).isEqualTo("Guns & Bombs");
  assertThat(merchant.getPayback()).isEqualTo(Percentage.of("6%"));
}

代码示例来源:origin: warszawajug/spring-labs

@Test
public void shouldFindMerchantByNumber() {
  Merchant merchant = repository.findByNumber("1234567890");
  assertThat(merchant).isNotNull();
  assertThat(merchant.getNumber()).isEqualTo("1234567890");
  assertThat(merchant.getName()).isEqualTo("Guns & Bombs");
  assertThat(merchant.getPayback()).isEqualTo(Percentage.of("6%"));
}

代码示例来源:origin: warszawajug/spring-labs

@Test
public void shouldFindMerchantByNumber() {
  Merchant merchant = repository.findByNumber("1234567890");
  assertThat(merchant).isNotNull();
  assertThat(merchant.getNumber()).isEqualTo("1234567890");
  assertThat(merchant.getName()).isEqualTo("Guns & Bombs");
  assertThat(merchant.getPayback()).isEqualTo(Percentage.of("6%"));
}

代码示例来源:origin: warszawajug/spring-labs

@Test
public void shouldFindMerchantByNumber() {
  Merchant merchant = repository.findByNumber("1234567890");
  assertThat(merchant).isNotNull();
  assertThat(merchant.getNumber()).isEqualTo("1234567890");
  assertThat(merchant.getName()).isEqualTo("Guns & Bombs");
  assertThat(merchant.getPayback()).isEqualTo(Percentage.of("6%"));
}

代码示例来源:origin: warszawajug/spring-labs

@Test
  public void shouldFindByNumber() throws Exception {
    Merchant merchant = repository.findByNumber(PaybackFixture.merchantNumber);

    assertThat(merchant).isNotNull();
    assertThat(merchant.getId()).isEqualTo(1L);
    assertThat(merchant.getName()).isEqualTo("Guns & Bombs");
    assertThat(merchant.getPayback()).isEqualTo(Percentage.of("6%"));
    assertThat(merchant.getPaybackPolicy()).isEqualTo(PaybackPolicy.ALWAYS);
  }
}

代码示例来源:origin: warszawajug/spring-labs

@Test
  public void shouldFindByNumber() throws Exception {
    Merchant merchant = repository.findByNumber(PaybackFixture.merchantNumber);

    assertThat(merchant).isNotNull();
    assertThat(merchant.getId()).isEqualTo(1L);
    assertThat(merchant.getName()).isEqualTo("Guns & Bombs");
    assertThat(merchant.getPayback()).isEqualTo(Percentage.of("6%"));
    assertThat(merchant.getPaybackPolicy()).isEqualTo(PaybackPolicy.ALWAYS);
  }
}

代码示例来源:origin: warszawajug/spring-labs

@Test
  public void shouldFindByNumber() throws Exception {
    Merchant merchant = repository.findByNumber(PaybackFixture.merchantNumber);

    assertThat(merchant).isNotNull();
    assertThat(merchant.getId()).isEqualTo(1L);
    assertThat(merchant.getName()).isEqualTo("Guns & Bombs");
    assertThat(merchant.getPayback()).isEqualTo(Percentage.of("6%"));
    assertThat(merchant.getPaybackPolicy()).isEqualTo(PaybackPolicy.ALWAYS);
  }
}

代码示例来源:origin: warszawajug/spring-labs

@Test
  public void shouldFindByNumber() throws Exception {
    Merchant merchant = repository.findByNumber(PaybackFixture.merchantNumber);

    assertThat(merchant).isNotNull();
    assertThat(merchant.getId()).isEqualTo(1L);
    assertThat(merchant.getName()).isEqualTo("Guns & Bombs");
    assertThat(merchant.getPayback()).isEqualTo(Percentage.of("6%"));
    assertThat(merchant.getPaybackPolicy()).isEqualTo(PaybackPolicy.ALWAYS);
  }
}

相关文章