congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ByteSizeStrings.parse
Code IndexAdd Tabnine to your IDE (free)

How to use
parse
method
in
org.apache.brooklyn.util.text.ByteSizeStrings

Best Java code snippets using org.apache.brooklyn.util.text.ByteSizeStrings.parse (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: org.apache.brooklyn/brooklyn-utils-common

public static long parse(String sizeString) {
  return parse(sizeString, null);
}
public static long parse(String sizeString, String defaultUnits) {
origin: org.apache.brooklyn/brooklyn-utils-common

public static long parse(String sizeString, String defaultUnits) {
  return parse(sizeString, defaultUnits, null);
}
/** parses the given string as a byte size string, e.g. "4gb"
origin: io.brooklyn.clocker/brooklyn-clocker-mesos

private Long parseSizeString(Object obj, String defaultUnit) {
  if (obj == null) return null;
  return ByteSizeStrings.parse(Strings.toString(obj), defaultUnit);
}

origin: org.apache.brooklyn/brooklyn-utils-common

public void testParse() {
  assertEquals(ByteSizeStrings.parse("1", "k"), 1024);
  assertEquals(ByteSizeStrings.parse("1b"), 1);
  assertEquals(ByteSizeStrings.parse("1k"), 1024);
  assertEquals(ByteSizeStrings.parse("1m"), 1024*1024);
  assertEquals(ByteSizeStrings.parse("1g"), 1024*1024*1024);
  assertEquals(ByteSizeStrings.parse("1t"), 1024L*1024*1024*1024);
  assertEquals(ByteSizeStrings.parse("64.0 KiB"), 65536);
  assertEquals(ByteSizeStrings.parse("64.0 KB"), 64000);
  assertEquals(ByteSizeStrings.parse("64.0k"), 65536);
  assertEquals(ByteSizeStrings.parse("64k"), 65536);
  assertEquals(ByteSizeStrings.parse("64 k"), 65536);
  assertEquals(ByteSizeStrings.parse("0.5t"), 512L*1024*1024*1024);
  assertEquals(ByteSizeStrings.parse("1", "k"), 1024);
  assertEquals(ByteSizeStrings.parse("1k", "m"), 1024);
  assertEquals(ByteSizeStrings.parse("1k", "m", ByteSizeStrings.metric()), 1000);
org.apache.brooklyn.util.textByteSizeStringsparse

Javadoc

parses the given string as a byte size string, e.g. "4gb"

Popular methods of ByteSizeStrings

  • metric
    Default byte size formatter using metric multiples of 1000.
  • java
    Format byte sizes suitable for Java -Xms arguments.
  • makeSizeString
    Format the size bytes as a String with the given precision.
  • iso
    Formats byte sizes using ISO standard suffixes and binary multiples of 1024
  • <init>
  • apply
    A Function implementation that formats its input using the current ByteSizeStrings values.
  • builder
    Returns a builder for a ByteSizeStrings formatter.
  • formatted
    Returns a Formattable object that can be used with String#format(String,Object...). When used as the

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • Menu (java.awt)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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