Git Product home page Git Product logo

giftwrap's Introduction

Giftwrap

A class to simplify adding items to a Bundle in Android. Multiple calls to the various put methods of the Bundle can be replaced with multiple calls to the single put method of this class, and a final call to wrap to return the finished Bundle.

For example, the following:

Bundle bundle = new Bundle();
bundle.putInt("myInt", 1);
bundle.putBoolean("myBoolean", true);
bundle.putDouble("myDouble", 2.2);
bundle.putString("myString", "Hello");

can be replaced with:

Bundle bundle = new Giftwrap()
      .put("myInt", 1)
      .put("myBoolean", true)
      .put("myDouble", 2.2)
      .put("myString", "Hello")
      .wrap();

Though the Bundle class has methods for adding ArrayLists of various types, all ArrayLists added via Giftwrap are added with Bundle.putSerializable and can be retrieved in their original form via the Bundle's various get methods for ArrayLists, such as Bundle.getIntegerArrayList. Similarly, Strings are added using Bundle.putCharSequence but can still be retrieved using Bundle.getString.

giftwrap's People

Contributors

ganderson04 avatar

Stargazers

Ross McCully avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.