Saber (Parent)

SharedPreferences "injection" for Android.

License

License

GroupId

GroupId

com.jug6ernaut
ArtifactId

ArtifactId

saber-parent
Last Version

Last Version

0.5.0
Release Date

Release Date

Type

Type

pom
Description

Description

Saber (Parent)
SharedPreferences "injection" for Android.
Project URL

Project URL

http://github.com/jug6ernaut/saber/
Source Code Management

Source Code Management

http://github.com/jug6ernaut/saber/

Download saber-parent

Filename Size
saber-parent-0.5.0.pom 7 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/com.jug6ernaut/saber-parent/ -->
<dependency>
    <groupId>com.jug6ernaut</groupId>
    <artifactId>saber-parent</artifactId>
    <version>0.5.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.jug6ernaut/saber-parent/
implementation 'com.jug6ernaut:saber-parent:0.5.0'
// https://jarcasting.com/artifacts/com.jug6ernaut/saber-parent/
implementation ("com.jug6ernaut:saber-parent:0.5.0")
'com.jug6ernaut:saber-parent:pom:0.5.0'
<dependency org="com.jug6ernaut" name="saber-parent" rev="0.5.0">
  <artifact name="saber-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.jug6ernaut', module='saber-parent', version='0.5.0')
)
libraryDependencies += "com.jug6ernaut" % "saber-parent" % "0.5.0"
[com.jug6ernaut/saber-parent "0.5.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • saber
  • saber-sample

Saber Build Status

Android SharedPreferences wrapper and injector. Based on Dart, which was originally based on ButterKnife.

SharedPreference "injection" library for Android which uses annotation processing to generate code that does direct field assignment of your SharedPreference..

Usage

@PreferenceConfig(file = "someFile") // optional, file used for all sub @Preference unless override
public class MainActivity extends Activity {

  @Bind Preference<Boolean> boolPreference; // no information needed

  @Override protected void onCreate(Bundle savedInstanceState) {
    Saber.inject(this);

    Boolean bool = boolPreference.get();
    boolPreference.set(true);
  }
  
}

Saber provides wrapper classes for all shared preference applicable value types, preferenceType safe and null safe.

IntPreference
LongPreference
FloatPreference
BooleanPreference
StringPreference
StringSetPreference

Configuration

@Bind Has 3 fields, all optional

key Key to be used, if not provided variable name is used.

file File to use, if not provided the default is used.

dv Default value to be used, if not provided the class specific value will be used.

Download

Download the latest JAR via Maven:

<dependency>
  <groupId>com.jug6ernaut.saber</groupId>
  <artifactId>saber</artifactId>
  <version>0.6.0</version>
</dependency>

or Gradle:

compile 'com.jug6ernaut.saber:saber:0.6.0'

License

Copyright 2015 William Webb
Copyright 2014 Prateek Srivastava (@f2prateek)
Copyright 2013 Jake Wharton

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
0.5.0