Commit c34851e1 authored by AtjonTV's avatar AtjonTV 🇷🇺

Release 3.2.0

* Added
  * 'print' Top-Level Function
  * 'binSearch' extension for List
  * 'binSearch' extension for MutableList
  * Http.custom function
  * Konfig now supports Lists/Arrays
  * kLib is now shipping with JSON Parser (it adds about 300KB to builds)

* Changed
  * Extended Http.get with headers parameter
  * Extended Http.post with headers parameter
  * Default JsonHandler now uses JSON Parser and actually works
parent 17e71d10
Pipeline #2040 passed with stages
in 5 minutes and 6 seconds
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectNotificationSettings">
<option name="askShowProject" value="false" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
......
......@@ -13,6 +13,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
## 3.2.0 - 12.09.2019
### Added
- `print` Top-Level Function
- `binSearch` extension for List
- `binSearch` extension for MutableList
- Http.custom function
- Konfig now supports Lists/Arrays
- kLib is now shipping with JSON Parser (it adds about 300KB to builds)
### Changed
- Extended Http.get with headers parameter
- Extended Http.post with headers parameter
- Default JsonHandler now uses JSON Parser and actually works
## 3.1.0 - 12.06.2019
### Added
......@@ -287,7 +302,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Overview
* Unreleased - [Diff 3.0.0 to master](https://gitlab.atvg-studios.at/atvg-studios/kLib/compare/3.0.0...master)
* Unreleased - [Diff 3.2.0 to master](https://gitlab.atvg-studios.at/atvg-studios/kLib/compare/3.2.0...master)
* 3.2.0 - [Diff 3.1.0 to 3.2.0](https://gitlab.atvg-studios.at/atvg-studios/kLib/compare/3.1.0...3.2.0)
* 3.1.0 - [Diff 3.0.0 to 3.1.0](https://gitlab.atvg-studios.at/atvg-studios/kLib/compare/3.0.0...3.1.0)
* 3.0.0 - [Diff 2.1.1 to 3.0.0](https://gitlab.atvg-studios.at/atvg-studios/kLib/compare/2.1.1...3.0.0)
* 2.1.1 - [Diff 2.1.0 to 2.1.1](https://gitlab.atvg-studios.at/atvg-studios/kLib/compare/2.1.0...2.1.1)
* 2.1.0 - [Diff 2.0.0 to 2.1.0](https://gitlab.atvg-studios.at/atvg-studios/kLib/compare/2.0.0...2.1.0)
......
......@@ -12,7 +12,7 @@ Breaking versions must be in a new row!
| 7 | 0.1.6 |
| 8 - 15| 0.2.0 - 1.4.0 |
|16 - 19| 2.0.0 - 2.1.1 |
|20 - 21| 3.0.0 - 3.1.0 |
|20 - 22| 3.0.0 - 3.2.0 |
This means: `0.1.2` **IS** compatible with `0.1.3` but **NOT** compatible with `0.1.0` and `0.1.1`.
......
......@@ -2,11 +2,10 @@
| Branch | Status |
|--------|--------|
| master | [![pipeline status](https://gitlab.atvg-studios.at/atvg-studios/kLib/badges/master/pipeline.svg)](https://gitlab.atvg-studios.at/atvg-studios/kLib/commits/master) |
| release/1.4.x | [![pipeline status](https://gitlab.atvg-studios.at/atvg-studios/kLib/badges/release/1.4.x/pipeline.svg)](https://gitlab.atvg-studios.at/atvg-studios/kLib/commits/release/1.4.x) |
| release/2.0.x | [![pipeline status](https://gitlab.atvg-studios.at/atvg-studios/kLib/badges/release/2.0.x/pipeline.svg)](https://gitlab.atvg-studios.at/atvg-studios/kLib/commits/release/2.0.x) |
| release/2.1.x | [![pipeline status](https://gitlab.atvg-studios.at/atvg-studios/kLib/badges/release/2.1.x/pipeline.svg)](https://gitlab.atvg-studios.at/atvg-studios/kLib/commits/release/2.1.x) |
| release/3.0.x | [![pipeline status](https://gitlab.atvg-studios.at/atvg-studios/kLib/badges/release/3.0.x/pipeline.svg)](https://gitlab.atvg-studios.at/atvg-studios/kLib/commits/release/3.0.x) |
| master | [![pipeline status](https://gitlab.atvg-studios.com/atvg-studios/kLib/badges/master/pipeline.svg)](https://gitlab.atvg-studios.at/atvg-studios/kLib/commits/master) |
| release/3.0.x | [![pipeline status](https://gitlab.atvg-studios.com/atvg-studios/kLib/badges/release/3.0.x/pipeline.svg)](https://gitlab.atvg-studios.at/atvg-studios/kLib/commits/release/3.0.x) |
| release/3.1.x | [![pipeline status](https://gitlab.atvg-studios.com/atvg-studios/kLib/badges/release/3.0.x/pipeline.svg)](https://gitlab.atvg-studios.at/atvg-studios/kLib/commits/release/3.1.x) |
| release/3.2.x | [![pipeline status](https://gitlab.atvg-studios.com/atvg-studios/kLib/badges/release/3.0.x/pipeline.svg)](https://gitlab.atvg-studios.at/atvg-studios/kLib/commits/release/3.2.x) |
kLib is a in Kotlin written Library by ATVG-Studios containing a set of useful Functions,
Extensions and Types.
......@@ -16,14 +15,14 @@ kLib works as a Standard Library at ATVG-Studios containing code that can be use
Checkout the Homepage over [here](https://klib.atvg-studios.com).
kLib is now available via a custom Maven repository.
You can find the Git repository that hosts the Maven data [here](https://gitlab.atvg-studios.at/atvg-studios/maven-repository).
The Maven Repository itself is available here: https://mvn.osmium.software
You can find the Git repository that hosts the Maven data [here](https://gitlab.atvg-studios.com/atvg-studios/maven-repository).
The Maven Repository itself is available here: https://mvn.atvg-studios.com
Adding the latest version of kLib using Gradle:
```
repositories {
maven { url 'https://mvn.osmium.software' }
maven { url 'https://mvn.atvg-studios.com' }
}
dependencies {
......@@ -38,7 +37,7 @@ Adding the latest version of kLib using Maven:
<repository>
<id>atvg-studios</id>
<name>ATVG-Studios Maven</name>
<url>https://mvn.osmium.software</url>
<url>https://mvn.atvg-studios.com</url>
</repository>
</repositories>
<dependencies>
......@@ -71,7 +70,14 @@ Also what breaking changes where made when and which will come up in near future
## Outdated Versions
All versions before 1.4.0 are considered Legacy and are no longer developed or supported.
All listed versions are considered Legacy and are no longer developed or supported.
| Version Tree | Last Version |
|--------------|--------------|
| 0.1.x | 0.1.6 |
| 0.2.x | 0.2.2 |
| 1.x.x | 1.4.0 |
| 2.x.x | 2.1.1 |
# License
......
plugins {
id 'com.github.johnrengelman.shadow' version '5.0.0'
id 'org.jetbrains.kotlin.jvm' version '1.3.31'
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
id 'org.jetbrains.dokka' version '0.9.18'
id 'maven-publish'
id 'signing'
}
group 'klib'
version '3.1.0'
version '3.2.0'
repositories {
mavenCentral()
......@@ -18,10 +18,10 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
dokkaRuntime "org.jetbrains.dokka:dokka-fatjar:0.9.18"
testImplementation "org.jetbrains.kotlin:kotlin-test:1.3.31"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:1.3.31"
testImplementation "org.jetbrains.kotlin:kotlin-test-common:1.3.31"
testImplementation "org.jetbrains.kotlin:kotlin-test-annotations-common:1.3.31"
testImplementation "org.jetbrains.kotlin:kotlin-test:1.3.50"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:1.3.50"
testImplementation "org.jetbrains.kotlin:kotlin-test-common:1.3.50"
testImplementation "org.jetbrains.kotlin:kotlin-test-annotations-common:1.3.50"
}
compileKotlin {
......
......@@ -20,6 +20,7 @@ This is the basics:
+ Every non-comment line **MUST** have a `=`
+ Every line **CAN** have spaces, underscores, dashes and dots as keys (left side of `=`)
+ Every line **CAN** have any type of data (right side of `=`)
+ Every line holding a list **MUST** use `[]` around `,` separated data
```
# comment
......@@ -28,4 +29,11 @@ another_key=Another Value
another-key=Yet another value!!!1!
another.key=Jup some more data
one=1
list=["this","is","a","list"]
```
# Data Types
+ Int: key=1
+ String: key="hello"
+ List: key=[1,2,3,"hello"]
\ No newline at end of file
#!/bin/bash
VERSION="3.1.0"
VERSION="3.2.0"
mvn gpg:sign-and-deploy-file \
-DrepositoryId=atvg-studios \
......
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.atvgstudios</groupId>
<artifactId>klib</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<name>kLib</name>
<description>kLib is a in Kotlin written Library by ATVG-Studios containing a set of useful Functions, Extensions and Types.</description>
<url>https://klib.atvg-studios.com/</url>
......@@ -21,15 +21,15 @@
</developer>
</developers>
<scm>
<connection>scm:git:git://gitlab.atvg-studios.at/atvg-studios/kLib.git</connection>
<developerConnection>scm:git:ssh://gitlab.atvg-studios.at/atvg-studios/kLib.git</developerConnection>
<url>https://gitlab.atvg-studios.at/atvg-studios/kLib.git</url>
<connection>scm:git:git://gitlab.atvg-studios.com/atvg-studios/kLib.git</connection>
<developerConnection>scm:git:ssh://gitlab.atvg-studios.com/atvg-studios/kLib.git</developerConnection>
<url>https://gitlab.atvg-studios.com/atvg-studios/kLib.git</url>
</scm>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>1.3.31</version>
<version>1.3.50</version>
<scope>runtime</scope>
</dependency>
</dependencies>
......
/*
* Copyright (C) 2008 Google Inc.
*
* 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.
*/
package com.google.gson;
import java.io.IOException;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import com.google.gson.internal.JavaVersion;
import com.google.gson.internal.PreJava9DateFormatProvider;
import com.google.gson.internal.bind.util.ISO8601Utils;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
/**
* This type adapter supports three subclasses of date: Date, Timestamp, and
* java.sql.Date.
*
* @author Inderjeet Singh
* @author Joel Leitch
*/
final class DefaultDateTypeAdapter extends TypeAdapter<Date> {
private static final String SIMPLE_NAME = "DefaultDateTypeAdapter";
private final Class<? extends Date> dateType;
/**
* List of 1 or more different date formats used for de-serialization attempts.
* The first of them is used for serialization as well.
*/
private final List<DateFormat> dateFormats = new ArrayList<DateFormat>();
DefaultDateTypeAdapter(Class<? extends Date> dateType) {
this.dateType = verifyDateType(dateType);
dateFormats.add(DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.US));
if (!Locale.getDefault().equals(Locale.US)) {
dateFormats.add(DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT));
}
if (JavaVersion.isJava9OrLater()) {
dateFormats.add(PreJava9DateFormatProvider.getUSDateTimeFormat(DateFormat.DEFAULT, DateFormat.DEFAULT));
}
}
DefaultDateTypeAdapter(Class<? extends Date> dateType, String datePattern) {
this.dateType = verifyDateType(dateType);
dateFormats.add(new SimpleDateFormat(datePattern, Locale.US));
if (!Locale.getDefault().equals(Locale.US)) {
dateFormats.add(new SimpleDateFormat(datePattern));
}
}
DefaultDateTypeAdapter(Class<? extends Date> dateType, int style) {
this.dateType = verifyDateType(dateType);
dateFormats.add(DateFormat.getDateInstance(style, Locale.US));
if (!Locale.getDefault().equals(Locale.US)) {
dateFormats.add(DateFormat.getDateInstance(style));
}
if (JavaVersion.isJava9OrLater()) {
dateFormats.add(PreJava9DateFormatProvider.getUSDateFormat(style));
}
}
public DefaultDateTypeAdapter(int dateStyle, int timeStyle) {
this(Date.class, dateStyle, timeStyle);
}
public DefaultDateTypeAdapter(Class<? extends Date> dateType, int dateStyle, int timeStyle) {
this.dateType = verifyDateType(dateType);
dateFormats.add(DateFormat.getDateTimeInstance(dateStyle, timeStyle, Locale.US));
if (!Locale.getDefault().equals(Locale.US)) {
dateFormats.add(DateFormat.getDateTimeInstance(dateStyle, timeStyle));
}
if (JavaVersion.isJava9OrLater()) {
dateFormats.add(PreJava9DateFormatProvider.getUSDateTimeFormat(dateStyle, timeStyle));
}
}
private static Class<? extends Date> verifyDateType(Class<? extends Date> dateType) {
if ( dateType != Date.class && dateType != java.sql.Date.class && dateType != Timestamp.class ) {
throw new IllegalArgumentException("Date type must be one of " + Date.class + ", " + Timestamp.class + ", or " + java.sql.Date.class + " but was " + dateType);
}
return dateType;
}
// These methods need to be synchronized since JDK DateFormat classes are not thread-safe
// See issue 162
@Override
public void write(JsonWriter out, Date value) throws IOException {
if (value == null) {
out.nullValue();
return;
}
synchronized(dateFormats) {
String dateFormatAsString = dateFormats.get(0).format(value);
out.value(dateFormatAsString);
}
}
@Override
public Date read(JsonReader in) throws IOException {
if (in.peek() == JsonToken.NULL) {
in.nextNull();
return null;
}
Date date = deserializeToDate(in.nextString());
if (dateType == Date.class) {
return date;
} else if (dateType == Timestamp.class) {
return new Timestamp(date.getTime());
} else if (dateType == java.sql.Date.class) {
return new java.sql.Date(date.getTime());
} else {
// This must never happen: dateType is guarded in the primary constructor
throw new AssertionError();
}
}
private Date deserializeToDate(String s) {
synchronized (dateFormats) {
for (DateFormat dateFormat : dateFormats) {
try {
return dateFormat.parse(s);
} catch (ParseException ignored) {}
}
try {
return ISO8601Utils.parse(s, new ParsePosition(0));
} catch (ParseException e) {
throw new JsonSyntaxException(s, e);
}
}
}
@Override
public String toString() {
DateFormat defaultFormat = dateFormats.get(0);
if (defaultFormat instanceof SimpleDateFormat) {
return SIMPLE_NAME + '(' + ((SimpleDateFormat) defaultFormat).toPattern() + ')';
} else {
return SIMPLE_NAME + '(' + defaultFormat.getClass().getSimpleName() + ')';
}
}
}
/*
* Copyright (C) 2008 Google Inc.
*
* 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.
*/
package com.google.gson;
/**
* A strategy (or policy) definition that is used to decide whether or not a field or top-level
* class should be serialized or deserialized as part of the JSON output/input. For serialization,
* if the {@link #shouldSkipClass(Class)} method returns true then that class or field type
* will not be part of the JSON output. For deserialization, if {@link #shouldSkipClass(Class)}
* returns true, then it will not be set as part of the Java object structure.
*
* <p>The following are a few examples that shows how you can use this exclusion mechanism.
*
* <p><strong>Exclude fields and objects based on a particular class type:</strong>
* <pre class="code">
* private static class SpecificClassExclusionStrategy implements ExclusionStrategy {
* private final Class&lt;?&gt; excludedThisClass;
*
* public SpecificClassExclusionStrategy(Class&lt;?&gt; excludedThisClass) {
* this.excludedThisClass = excludedThisClass;
* }
*
* public boolean shouldSkipClass(Class&lt;?&gt; clazz) {
* return excludedThisClass.equals(clazz);
* }
*
* public boolean shouldSkipField(FieldAttributes f) {
* return excludedThisClass.equals(f.getDeclaredClass());
* }
* }
* </pre>
*
* <p><strong>Excludes fields and objects based on a particular annotation:</strong>
* <pre class="code">
* public &#64interface FooAnnotation {
* // some implementation here
* }
*
* // Excludes any field (or class) that is tagged with an "&#64FooAnnotation"
* private static class FooAnnotationExclusionStrategy implements ExclusionStrategy {
* public boolean shouldSkipClass(Class&lt;?&gt; clazz) {
* return clazz.getAnnotation(FooAnnotation.class) != null;
* }
*
* public boolean shouldSkipField(FieldAttributes f) {
* return f.getAnnotation(FooAnnotation.class) != null;
* }
* }
* </pre>
*
* <p>Now if you want to configure {@code Gson} to use a user defined exclusion strategy, then
* the {@code GsonBuilder} is required. The following is an example of how you can use the
* {@code GsonBuilder} to configure Gson to use one of the above sample:
* <pre class="code">
* ExclusionStrategy excludeStrings = new UserDefinedExclusionStrategy(String.class);
* Gson gson = new GsonBuilder()
* .setExclusionStrategies(excludeStrings)
* .create();
* </pre>
*
* <p>For certain model classes, you may only want to serialize a field, but exclude it for
* deserialization. To do that, you can write an {@code ExclusionStrategy} as per normal;
* however, you would register it with the
* {@link GsonBuilder#addDeserializationExclusionStrategy(ExclusionStrategy)} method.
* For example:
* <pre class="code">
* ExclusionStrategy excludeStrings = new UserDefinedExclusionStrategy(String.class);
* Gson gson = new GsonBuilder()
* .addDeserializationExclusionStrategy(excludeStrings)
* .create();
* </pre>
*
* @author Inderjeet Singh
* @author Joel Leitch
*
* @see GsonBuilder#setExclusionStrategies(ExclusionStrategy...)
* @see GsonBuilder#addDeserializationExclusionStrategy(ExclusionStrategy)
* @see GsonBuilder#addSerializationExclusionStrategy(ExclusionStrategy)
*
* @since 1.4
*/
public interface ExclusionStrategy {
/**
* @param f the field object that is under test
* @return true if the field should be ignored; otherwise false
*/
public boolean shouldSkipField(FieldAttributes f);
/**
* @param clazz the class object that is under test
* @return true if the class should be ignored; otherwise false
*/
public boolean shouldSkipClass(Class<?> clazz);
}
/*
* Copyright (C) 2009 Google Inc.
*
* 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.
*/
package com.google.gson;
import com.google.gson.internal.$Gson$Preconditions;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collection;
/**
* A data object that stores attributes of a field.
*
* <p>This class is immutable; therefore, it can be safely shared across threads.
*
* @author Inderjeet Singh
* @author Joel Leitch
*
* @since 1.4
*/
public final class FieldAttributes {
private final Field field;
/**
* Constructs a Field Attributes object from the {@code f}.
*
* @param f the field to pull attributes from
*/
public FieldAttributes(Field f) {
$Gson$Preconditions.checkNotNull(f);
this.field = f;
}
/**
* @return the declaring class that contains this field
*/
public Class<?> getDeclaringClass() {
return field.getDeclaringClass();
}
/**
* @return the name of the field
*/
public String getName() {
return field.getName();
}
/**
* <p>For example, assume the following class definition:
* <pre class="code">
* public class Foo {
* private String bar;
* private List&lt;String&gt; red;
* }
*
* Type listParameterizedType = new TypeToken&lt;List&lt;String&gt;&gt;() {}.getType();
* </pre>
*
* <p>This method would return {@code String.class} for the {@code bar} field and
* {@code listParameterizedType} for the {@code red} field.
*
* @return the specific type declared for this field
*/
public Type getDeclaredType() {
return field.getGenericType();
}
/**
* Returns the {@code Class} object that was declared for this field.
*
* <p>For example, assume the following class definition:
* <pre class="code">
* public class Foo {
* private String bar;
* private List&lt;String&gt; red;
* }
* </pre>
*
* <p>This method would return {@code String.class} for the {@code bar} field and
* {@code List.class} for the {@code red} field.
*
* @return the specific class object that was declared for the field
*/
public Class<?> getDeclaredClass() {
return field.getType();
}
/**
* Return the {@code T} annotation object from this field if it exist; otherwise returns
* {@code null}.
*
* @param annotation the class of the annotation that will be retrieved
* @return the annotation instance if it is bound to the field; otherwise {@code null}
*/
public <T extends Annotation> T getAnnotation(Class<T> annotation) {
return field.getAnnotation(annotation);
}
/**
* Return the annotations that are present on this field.
*
* @return an array of all the annotations set on the field
* @since 1.4
*/
public Collection<Annotation> getAnnotations() {
return Arrays.asList(field.getAnnotations());
}
/**
* Returns {@code true} if the field is defined with the {@code modifier}.
*
* <p>This method is meant to be called as:
* <pre class="code">
* boolean hasPublicModifier = fieldAttribute.hasModifier(java.lang.reflect.Modifier.PUBLIC);
* </pre>
*
* @see java.lang.reflect.Modifier
*/
public boolean hasModifier(int modifier) {
return (field.getModifiers() & modifier) != 0;
}
/**
* Returns the value of the field represented by this {@code Field}, on
* the specified object. The value is automatically wrapped in an
* object if it has a primitive type.
*
* @return the value of the represented field in object
* {@code obj}; primitive values are wrapped in an appropriate
* object before being returned
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
Object get(Object instance) throws IllegalAccessException {
return field.get(instance);
}
/**
* This is exposed internally only for the removing synthetic fields from the JSON output.
*
* @return true if the field is synthetic; otherwise false
*/
boolean isSynthetic() {
return field.isSynthetic();
}
}
/*
* Copyright (C) 2008 Google Inc.
*
* 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.
*/
package com.google.gson;
import java.lang.reflect.Field;
import java.util.Locale;
/**
* An enumeration that defines a few standard naming conventions for JSON field names.
* This enumeration should be used in conjunction with {@link com.google.gson.GsonBuilder}
* to configure a {@link com.google.gson.Gson} instance to properly translate Java field
* names into the desired JSON field names.
*
* @author Inderjeet Singh
* @author Joel Leitch
*/
public enum FieldNamingPolicy implements FieldNamingStrategy {