java.lang.Cloneable Java Examples

The following examples show how to use java.lang.Cloneable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TypeSpecTest.java    From javapoet with Apache License 2.0 6 votes vote down vote up
@Test public void enumImplements() throws Exception {
  TypeSpec typeSpec = TypeSpec.enumBuilder("Food")
      .addSuperinterface(Serializable.class)
      .addSuperinterface(Cloneable.class)
      .addEnumConstant("LEAN_GROUND_BEEF")
      .addEnumConstant("SHREDDED_CHEESE")
      .build();
  assertThat(toString(typeSpec)).isEqualTo(""
      + "package com.squareup.tacos;\n"
      + "\n"
      + "import java.io.Serializable;\n"
      + "import java.lang.Cloneable;\n"
      + "\n"
      + "enum Food implements Serializable, Cloneable {\n"
      + "  LEAN_GROUND_BEEF,\n"
      + "\n"
      + "  SHREDDED_CHEESE\n"
      + "}\n");
}
 
Example #2
Source File: HelloWorldHotswap.java    From HotswapAgentExamples with GNU General Public License v2.0 4 votes vote down vote up
public void dummy() {
    new Cloneable() {};
}