Tabnine Logo
Long.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
java.lang.Long
constructor

Best Java code snippets using java.lang.Long.<init> (Showing top 20 results out of 26,469)

origin: apache/incubator-dubbo

  private Object create(long initValue)
      throws IOException {
    if (initValue == Long.MIN_VALUE)
      throw new IOException(_cl.getName() + " expects name.");

    try {
      return _constructor.newInstance(new Object[]{new Long(initValue)});
    } catch (Exception e) {
      throw new IOExceptionWrapper(e);
    }
  }
}
origin: google/guava

@Generates
private Long generateLongObject() {
 return new Long(generateLong());
}
origin: spring-projects/spring-framework

private static BeanDefinition createScriptFactoryPostProcessor(boolean isRefreshable) {
  BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ScriptFactoryPostProcessor.class);
  if (isRefreshable) {
    builder.addPropertyValue("defaultRefreshCheckDelay", new Long(1));
  }
  return builder.getBeanDefinition();
}
origin: google/guava

public void testIdentity_notSame() {
 Function<Long, Long> identity = Functions.identity();
 assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
}
origin: google/guava

public void testEqualsAndHashCode() {
 new EqualsTester()
   .addEqualityGroup(Optional.absent(), reserialize(Optional.absent()))
   .addEqualityGroup(Optional.of(new Long(5)), reserialize(Optional.of(new Long(5))))
   .addEqualityGroup(Optional.of(new Long(42)), reserialize(Optional.of(new Long(42))))
   .testEquals();
}
origin: spring-projects/spring-framework

@Test
public void testGenericListOfMaps() throws MalformedURLException {
  GenericBean<String> gb = new GenericBean<>();
  List<Map<Integer, Long>> list = new LinkedList<>();
  list.add(new HashMap<>());
  gb.setListOfMaps(list);
  BeanWrapper bw = new BeanWrapperImpl(gb);
  bw.setPropertyValue("listOfMaps[0][10]", new Long(5));
  assertEquals(new Long(5), bw.getPropertyValue("listOfMaps[0][10]"));
  assertEquals(new Long(5), gb.getListOfMaps().get(0).get(10));
}
origin: spring-projects/spring-framework

@Test
public void testGenericMapOfMaps() throws MalformedURLException {
  GenericBean<String> gb = new GenericBean<>();
  Map<String, Map<Integer, Long>> map = new HashMap<>();
  map.put("mykey", new HashMap<>());
  gb.setMapOfMaps(map);
  BeanWrapper bw = new BeanWrapperImpl(gb);
  bw.setPropertyValue("mapOfMaps[mykey][10]", new Long(5));
  assertEquals(new Long(5), bw.getPropertyValue("mapOfMaps[mykey][10]"));
  assertEquals(new Long(5), gb.getMapOfMaps().get("mykey").get(10));
}
origin: spring-projects/spring-framework

@Test
public void testComplexGenericIndexedMapEntry() {
  List<String> inputValue = new LinkedList<>();
  inputValue.add("10");
  ComplexMapHolder holder = new ComplexMapHolder();
  BeanWrapper bw = new BeanWrapperImpl(holder);
  bw.setPropertyValue("genericIndexedMap[1]", inputValue);
  assertEquals(new Integer(1), holder.getGenericIndexedMap().keySet().iterator().next());
  assertEquals(new Long(10), holder.getGenericIndexedMap().values().iterator().next().get(0));
}
origin: spring-projects/spring-framework

@Test
public void testComplexGenericIndexedMapEntryWithCollectionConversion() {
  Set<String> inputValue = new HashSet<>();
  inputValue.add("10");
  ComplexMapHolder holder = new ComplexMapHolder();
  BeanWrapper bw = new BeanWrapperImpl(holder);
  bw.setPropertyValue("genericIndexedMap[1]", inputValue);
  assertEquals(new Integer(1), holder.getGenericIndexedMap().keySet().iterator().next());
  assertEquals(new Long(10), holder.getGenericIndexedMap().values().iterator().next().get(0));
}
origin: spring-projects/spring-framework

@Test
@Deprecated
public void hashCodeWithLong() {
  long lng = 883L;
  int expected = (new Long(lng)).hashCode();
  assertEquals(expected, ObjectUtils.hashCode(lng));
}
origin: spring-projects/spring-framework

@Test
public void testGenericMapWithKeyType() {
  GenericBean<?> gb = new GenericBean<>();
  BeanWrapper bw = new BeanWrapperImpl(gb);
  Map<String, String> input = new HashMap<>();
  input.put("4", "5");
  input.put("6", "7");
  bw.setPropertyValue("longMap", input);
  assertEquals("5", gb.getLongMap().get(new Long("4")));
  assertEquals("7", gb.getLongMap().get(new Long("6")));
}
origin: spring-projects/spring-framework

@Test
public void testGenericListOfMapsWithElementConversion() throws MalformedURLException {
  GenericBean<String> gb = new GenericBean<>();
  List<Map<Integer, Long>> list = new LinkedList<>();
  list.add(new HashMap<>());
  gb.setListOfMaps(list);
  BeanWrapper bw = new BeanWrapperImpl(gb);
  bw.setPropertyValue("listOfMaps[0][10]", "5");
  assertEquals(new Long(5), bw.getPropertyValue("listOfMaps[0][10]"));
  assertEquals(new Long(5), gb.getListOfMaps().get(0).get(10));
}
origin: spring-projects/spring-framework

@Test
public void testGenericMapOfMapsWithElementConversion() throws MalformedURLException {
  GenericBean<String> gb = new GenericBean<>();
  Map<String, Map<Integer, Long>> map = new HashMap<>();
  map.put("mykey", new HashMap<>());
  gb.setMapOfMaps(map);
  BeanWrapper bw = new BeanWrapperImpl(gb);
  bw.setPropertyValue("mapOfMaps[mykey][10]", "5");
  assertEquals(new Long(5), bw.getPropertyValue("mapOfMaps[mykey][10]"));
  assertEquals(new Long(5), gb.getMapOfMaps().get("mykey").get(10));
}
origin: spring-projects/spring-framework

@Test
public void testComplexDerivedIndexedMapEntryWithCollectionConversion() {
  Set<String> inputValue = new HashSet<>();
  inputValue.add("10");
  ComplexMapHolder holder = new ComplexMapHolder();
  BeanWrapper bw = new BeanWrapperImpl(holder);
  bw.setPropertyValue("derivedIndexedMap[1]", inputValue);
  assertEquals(new Integer(1), holder.getDerivedIndexedMap().keySet().iterator().next());
  assertEquals(new Long(10), holder.getDerivedIndexedMap().values().iterator().next().get(0));
}
origin: spring-projects/spring-framework

@Test
public void testComplexDerivedIndexedMapEntry() {
  List<String> inputValue = new LinkedList<>();
  inputValue.add("10");
  ComplexMapHolder holder = new ComplexMapHolder();
  BeanWrapper bw = new BeanWrapperImpl(holder);
  bw.setPropertyValue("derivedIndexedMap[1]", inputValue);
  assertEquals(new Integer(1), holder.getDerivedIndexedMap().keySet().iterator().next());
  assertEquals(new Long(10), holder.getDerivedIndexedMap().values().iterator().next().get(0));
}
origin: spring-projects/spring-framework

@Test
public void testGenericMapWithKeyTypeConstructor() {
  DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
  RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class);
  Map<String, String> input = new HashMap<>();
  input.put("4", "5");
  input.put("6", "7");
  rbd.getConstructorArgumentValues().addGenericArgumentValue(input);
  bf.registerBeanDefinition("genericBean", rbd);
  GenericBean<?> gb = (GenericBean<?>) bf.getBean("genericBean");
  assertEquals("5", gb.getLongMap().get(new Long("4")));
  assertEquals("7", gb.getLongMap().get(new Long("6")));
}
origin: spring-projects/spring-framework

@Test
public void uriTemplateWithObjectConversion() throws Exception {
  Map<String, Object> model = new HashMap<>();
  model.put("foo", new Long(611));
  RedirectView redirectView = new RedirectView("/foo/{foo}");
  redirectView.renderMergedOutputModel(model, this.request, this.response);
  assertEquals("/foo/611", this.response.getRedirectedUrl());
}
origin: spring-projects/spring-framework

@Test
public void resolveWiringInfo() {
  ClassNameBeanWiringInfoResolver resolver = new ClassNameBeanWiringInfoResolver();
  Long beanInstance = new Long(1);
  BeanWiringInfo info = resolver.resolveWiringInfo(beanInstance);
  assertNotNull(info);
  assertEquals("Not resolving bean name to the class name of the supplied bean instance as per class contract.",
      beanInstance.getClass().getName(), info.getBeanName());
}
origin: spring-projects/spring-framework

@Test
public void testSettingLongPropertyWithGenericInterface() {
  Promotion bean = new Promotion();
  BeanWrapper bw = new BeanWrapperImpl(bean);
  bw.setPropertyValue("id", "10");
  assertEquals(new Long(10), bean.getId());
}
origin: spring-projects/spring-framework

@Test
public void testGenericMapElementWithKeyType() {
  GenericBean<?> gb = new GenericBean<>();
  gb.setLongMap(new HashMap<Long, Integer>());
  BeanWrapper bw = new BeanWrapperImpl(gb);
  bw.setPropertyValue("longMap[4]", "5");
  assertEquals("5", gb.getLongMap().get(new Long("4")));
  assertEquals("5", bw.getPropertyValue("longMap[4]"));
}
java.langLong<init>

Javadoc

Constructs a new Long with the specified primitive long value.

Popular methods of Long

  • parseLong
    Parses the string argument as a signed long in the radix specified by the second argument. The chara
  • toString
    Returns a string representation of the first argument in the radix specified by the second argument.
  • valueOf
    Returns a Long object holding the value extracted from the specified String when parsed with the rad
  • longValue
    Returns the value of this Long as a long value.
  • intValue
    Returns the value of this Long as an int.
  • equals
    Compares this object to the specified object. The result is true if and only if the argument is not
  • hashCode
  • toHexString
    Returns a string representation of the longargument as an unsigned integer in base 16.The unsigned l
  • compareTo
    Compares this Long object to another object. If the object is a Long, this function behaves likecomp
  • compare
    Compares two long values numerically. The value returned is identical to what would be returned by:
  • doubleValue
    Returns the value of this Long as a double.
  • decode
    Decodes a String into a Long. Accepts decimal, hexadecimal, and octal numbers given by the following
  • doubleValue,
  • decode,
  • numberOfLeadingZeros,
  • numberOfTrailingZeros,
  • bitCount,
  • signum,
  • reverseBytes,
  • toBinaryString,
  • shortValue

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • IsNull (org.hamcrest.core)
    Is the value null?
  • CodeWhisperer alternatives
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