it.tidalwave.util.As.as()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(201)

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

As.as介绍

暂无

代码示例

代码示例来源:origin: it.tidalwave.bluemarine2/it-tidalwave-bluemarine2-model

/*******************************************************************************************************************
 *
 *
 *
 ******************************************************************************************************************/
@Nonnull // FIXME: this should be normally done by as()
private static SimpleComposite8 asSimpleComposite (final @Nonnull As object)
 {
  return (object instanceof SimpleComposite8) ? (SimpleComposite8)object : object.as(SimpleComposite8);
 }

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-observation-simple

public int compare (final @Nonnull As o1, final @Nonnull As o2)
  {
   return DISPLAYABLE_COMPARATOR.compare(o1.as(Displayable), o2.as(Displayable));
  }
};

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-openrdf-elmo

/*******************************************************************************************************************
 *
 *
 ******************************************************************************************************************/
@Override
public void setDisplayName (final @Nonnull String displayName)
 {
  SkosConceptUtils.setDisplayName(object.as(Entity.class), displayName);
 }

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-openrdf-elmo

/*******************************************************************************************************************
 *
 *
 ******************************************************************************************************************/
@Override
public void setDisplayName (final @Nonnull String displayName,
              final @Nonnull Locale locale)
 {
  SkosConceptUtils.setDisplayName(object.as(Entity.class), displayName, locale);
 }

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-openrdf-elmo

/*******************************************************************************************************************
 *
 *
 ******************************************************************************************************************/
@Override @Nonnull
public String getDisplayName (final @Nonnull Locale locale)
 {
  return SkosConceptUtils.getDisplayName(object.as(Entity.class), locale);
 }

代码示例来源:origin: it.tidalwave.thesefoolishthings/it-tidalwave-role

@Override
 public int compare (final @Nonnull As object1, final @Nonnull As object2)
  {
   return collator.compare(object1.as(Displayable).getDisplayName(), object2.as(Displayable).getDisplayName());
  }
}

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-openrdf-elmo

/*******************************************************************************************************************
 *
 *
 ******************************************************************************************************************/
@Override @Nonnull
public String getDisplayName()
 {
  return SkosConceptUtils.getDisplayName(object.as(Entity.class));
 }

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-openrdf-elmo

@Override @Nonnull
 protected Set<Concept> doCompute()
  {
   // FIXME: implement as a query
   return object.as(Concept.class).getSkosNarrowers();
  }
};

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-openrdf-elmo

@Override
 protected void process (final @Nonnull Set<String> auxStatements)
  {
   idMapByPlaceHolder.put("id", object.as(Entity.class).getQName());
   auxStatements.add(String.format("{ ?id owl:sameAs ?%s } UNION { ?%s owl:sameAs ?id }", entityName, entityName));
  }
};

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-openrdf-elmo

@Override @Nonnull
 protected Set<Concept> doCompute()
  {
   // FIXME: implement as a query
   return object.as(Concept.class).getSkosBroaders();
  }
};

代码示例来源:origin: it.tidalwave.bluemarine2/it-tidalwave-bluemarine2-model

@Nonnull
 private static String displayName (final @Nonnull As object)
  {
   try
    {
     return object.as(Displayable).getDisplayName();
    }
   catch (AsException e)
    {
     return "???";
    }
  }
}

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-android-utilities

public void update (final @Nonnull TextView textView) 
  {
   getItem(index).as(TextViewRenderable).renderTo(textView);
  }                    
});

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-openrdf-elmo

/*******************************************************************************************************************
   *
   *
   ******************************************************************************************************************/
  @Override
  public void addSameAs (final @Nonnull As other)
   {
    final Thing unwrappedObject1 = Wrapper.unwrap(object.as(Thing.class));
    final Thing unwrappedObject2 = Wrapper.unwrap(other.as(Thing.class));
    unwrappedObject1.getOwlSameAs().add(unwrappedObject2);
//            ((Thing)geoNode).getOwlSameAs().add((Thing)entity); // FIXME: see note in Utils.findSameAs()
   }
 }

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-openrdf-elmo

/*******************************************************************************************************************
  *
  *
  ******************************************************************************************************************/
 private static void createBroaderNarrowerRelationship (final @Nonnull As broader, final @Nonnull As narrower)
  {
   final Concept unwrappedBroader = Wrapper.unwrap(broader.as(Concept.class));
   final Concept unwrapperNarrower = Wrapper.unwrap(narrower.as(Concept.class));
   unwrappedBroader.getSkosNarrowers().add(unwrapperNarrower);
   unwrapperNarrower.getSkosBroaders().add(unwrappedBroader); // FIXME: see note in Utils.findSameAs()
  }
}

代码示例来源:origin: it.tidalwave.thesefoolishthings/it-tidalwave-role

@Nonnull
 private static As createAs (final @Nonnull Displayable displayable)
  {
   final As as = mock(As.class);
   when(as.as(eq(Displayable.class))).thenReturn(displayable);
   return as;
  }
}

代码示例来源:origin: it.tidalwave.geo/it-tidalwave-geo-location-elmo

/*******************************************************************************************************************
 *
 *
 ******************************************************************************************************************/
protected static void merge (final @Nonnull As object) // FIXME: move to an injected capability - Persistence?
 {
  Parameters.notNull("object", object);
  final Entity entity = Wrapper.unwrap(object.as(Entity.class));
  ElmoManagerThreadLocal.get().merge(entity);
 }

代码示例来源:origin: it.tidalwave.northernwind.rca/it-tidalwave-role-ui-javafx

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_set_text_from_Displayable_when_non_empty()
 {
  final As asObject = mock(As.class);
  when(asObject.as(eq(Displayable))).thenReturn(new DefaultDisplayable("foo"));
  fixture.updateItem(asObject, false);
  assertThat(fixture.getText(), is("foo"));
 }

代码示例来源:origin: it.tidalwave.northernwind.rca/it-tidalwave-role-ui-javafx

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_set_empty_test_when_empty()
 {
  final As asObject = mock(As.class);
  when(asObject.as(eq(Displayable))).thenReturn(new DefaultDisplayable("foo"));
  fixture.updateItem(asObject, true);
  assertThat(fixture.getText(), is(""));
 }

代码示例来源:origin: it.tidalwave.steelblue/it-tidalwave-role-ui-javafx

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_set_text_from_Displayable_when_non_empty()
 {
  final As asObject = mock(As.class);
  when(asObject.as(eq(Displayable))).thenReturn(new DefaultDisplayable("foo"));
  underTest.updateItem(asObject, false);
  assertThat(underTest.getText(), is("foo"));
 }

代码示例来源:origin: it.tidalwave.steelblue/it-tidalwave-role-ui-javafx

/*******************************************************************************************************************
 *
 ******************************************************************************************************************/
@Test
public void must_set_empty_test_when_empty()
 {
  final As asObject = mock(As.class);
  when(asObject.as(eq(Displayable))).thenReturn(new DefaultDisplayable("foo"));
  underTest.updateItem(asObject, true);
  assertThat(underTest.getText(), is(""));
 }

相关文章