Tabnine Logo
DataContainer.getLong
Code IndexAdd Tabnine to your IDE (free)

How to use
getLong
method
in
org.spongepowered.api.data.DataContainer

Best Java code snippets using org.spongepowered.api.data.DataContainer.getLong (Showing top 3 results out of 315)

origin: SpongePowered/SpongeAPI

@Test
public void testNumbers() {
  DataContainer container = DataContainer.createNew();
  DataQuery testQuery = of("foo", "bar");
  container.set(testQuery, 1.0D);
  Optional<Integer> integerOptional = container.getInt(testQuery);
  assertTrue(integerOptional.isPresent());
  assertTrue(integerOptional.get() == 1);
  Optional<Long> longOptional = container.getLong(testQuery);
  assertTrue(longOptional.isPresent());
  assertTrue(longOptional.get() == 1L);
  Optional<Double> doubleOptional = container.getDouble(testQuery);
  assertTrue(doubleOptional.isPresent());
  assertTrue(doubleOptional.get() == 1.0D);
}
origin: SpongePowered/SpongeAPI

@Test
public void testAbsents() {
  DataContainer container = DataContainer.createNew();
  DataQuery testQuery = of("foo", "bar", "baz");
  assertTrue(!container.get(testQuery).isPresent());
  assertTrue(!container.getBoolean(testQuery).isPresent());
  assertTrue(!container.getBooleanList(testQuery).isPresent());
  assertTrue(!container.getByteList(testQuery).isPresent());
  assertTrue(!container.getCharacterList(testQuery).isPresent());
  assertTrue(!container.getDouble(testQuery).isPresent());
  assertTrue(!container.getDoubleList(testQuery).isPresent());
  assertTrue(!container.getFloatList(testQuery).isPresent());
  assertTrue(!container.getInt(testQuery).isPresent());
  assertTrue(!container.getIntegerList(testQuery).isPresent());
  assertTrue(!container.getList(testQuery).isPresent());
  assertTrue(!container.getLong(testQuery).isPresent());
  assertTrue(!container.getLongList(testQuery).isPresent());
  assertTrue(!container.getMapList(testQuery).isPresent());
  assertTrue(!container.getShortList(testQuery).isPresent());
  assertTrue(!container.getString(testQuery).isPresent());
  assertTrue(!container.getStringList(testQuery).isPresent());
  assertTrue(!container.getView(testQuery).isPresent());
}
origin: EngineHub/CraftBook

@Override
public Optional<BlockBagData> from(DataContainer container) {
  if (container.contains(CraftBookKeys.BLOCK_BAG.getQuery())) {
    return Optional.of(new BlockBagData(container.getLong(CraftBookKeys.BLOCK_BAG.getQuery()).get()));
  }
  return Optional.empty();
}
org.spongepowered.api.dataDataContainergetLong

Popular methods of DataContainer

  • set
  • createNew
    Creates a new DataContainer with the provided org.spongepowered.api.data.DataView.SafetyMode.
  • get
  • contains
  • getInt
  • getSerializable
  • getString
  • getView
  • createView
  • copy
  • getBoolean
  • getBooleanList
  • getBoolean,
  • getBooleanList,
  • getByteList,
  • getCharacterList,
  • getDouble,
  • getDoubleList,
  • getFloatList,
  • getIntegerList,
  • getList

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now