com.spotify.mobius.Next.hasEffects()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(97)

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

Next.hasEffects介绍

[英]Check if this Next contains effects.
[中]检查下一步是否包含效果。

代码示例

代码示例来源:origin: spotify/mobius

@Override
protected boolean matchesSafely(Next<M, F> item, Description mismatchDescription) {
 if (item.hasEffects()) {
  mismatchDescription.appendText("has effects");
  return false;
 } else {
  mismatchDescription.appendText("no effects");
  return true;
 }
}

代码示例来源:origin: spotify/mobius

@Override
protected boolean matchesSafely(Next<M, F> item, Description mismatchDescription) {
 if (!item.hasEffects()) {
  mismatchDescription.appendText("no effects");
  return false;
 } else if (!matcher.matches(item.effects())) {
  mismatchDescription.appendText("bad effects: ");
  matcher.describeMismatch(item.effects(), mismatchDescription);
  return false;
 } else {
  mismatchDescription.appendText("has effects: ");
  matcher.describeMismatch(item.effects(), mismatchDescription);
  return true;
 }
}

代码示例来源:origin: spotify/mobius

@Test
public void nextNoEffectsOnlyHasModel() throws Exception {
 Next<String, String> next = Next.next("foo");
 assertTrue(next.hasModel());
 assertFalse(next.hasEffects());
}

代码示例来源:origin: spotify/mobius

@Test
public void nextNoopHasNoModelAndNoEffects() throws Exception {
 Next<String, String> next = noChange();
 assertFalse(next.hasModel());
 assertFalse(next.hasEffects());
}

代码示例来源:origin: spotify/mobius

@Test
public void nextEffectsOnlyHasEffects() throws Exception {
 Next<String, String> next = dispatch(effects("foo"));
 assertFalse(next.hasModel());
 assertTrue(next.hasEffects());
}

代码示例来源:origin: spotify/mobius

@Test
public void nextModelAndEffectsHasBothModelAndEffects() throws Exception {
 Next<String, String> next = Next.next("m", effects("f"));
 assertTrue(next.hasModel());
 assertTrue(next.hasEffects());
}

相关文章