AutoValue: Nested toString() Extension

AutoValue extension for prepending the enclosing classes names to a nested class's toString().

Лицензия

Лицензия

Категории

Категории

Auto Библиотеки уровня приложения Code Generators
Группа

Группа

com.christiangp
Идентификатор

Идентификатор

auto-value-nested-tostring
Последняя версия

Последняя версия

0.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

AutoValue: Nested toString() Extension
AutoValue extension for prepending the enclosing classes names to a nested class's toString().
Ссылка на сайт

Ссылка на сайт

https://github.com/ChristianGarcia/auto-value-nested-tostring/
Система контроля версий

Система контроля версий

https://github.com/ChristianGarcia/auto-value-nested-tostring/

Скачать auto-value-nested-tostring

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.christiangp/auto-value-nested-tostring/ -->
<dependency>
    <groupId>com.christiangp</groupId>
    <artifactId>auto-value-nested-tostring</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.christiangp/auto-value-nested-tostring/
implementation 'com.christiangp:auto-value-nested-tostring:0.2.0'
// https://jarcasting.com/artifacts/com.christiangp/auto-value-nested-tostring/
implementation ("com.christiangp:auto-value-nested-tostring:0.2.0")
'com.christiangp:auto-value-nested-tostring:jar:0.2.0'
<dependency org="com.christiangp" name="auto-value-nested-tostring" rev="0.2.0">
  <artifact name="auto-value-nested-tostring" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.christiangp', module='auto-value-nested-tostring', version='0.2.0')
)
libraryDependencies += "com.christiangp" % "auto-value-nested-tostring" % "0.2.0"
[com.christiangp/auto-value-nested-tostring "0.2.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
com.squareup : javapoet jar 1.8.0
com.google.auto.value : auto-value jar 1.4

test (3)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
com.google.truth : truth jar 0.32
com.google.testing.compile : compile-testing jar 0.9

Модули Проекта

Данный проект не имеет модулей.

AutoValue: Nested toString()

Build Status

An extension for Google's AutoValue that prepends the enclosing classes' names to the toString() method of a @Nested annotated nested class.

Usage

Apply the @Nested annotation to any nested class whose toString() you wish to modify in order to include the enclosing classes.

public class TopLevelClass {

  public static class NestedClass {
  
    @AutoValue
    @Nested
    public static abstract class NestedInNestedClass {
       public abstract String property();
    }
  }
}

When you call a NestedInNestedClass instance's toString() this will include the enclosing classes at the beginning

TopLevelClass.NestedClass.NestedInNestedClass{property=name} //auto-value-nested-tostring

as opposed to AutoValue's default (simple class name)

NestedInNestedClass{property=name} //AutoValue's default

Download

Add a Gradle dependency:

annotationProcessor 'com.christiangp:auto-value-nested-tostring:<latest_version>'
provided 'com.christiangp:auto-value-nested-tostring-annotations:<latest_version>'

or Maven:

<dependency>
  <groupId>com.christiangp</groupId>
  <artifactId>auto-value-nested-tostring</artifactId>
  <version>$latest_version</version>
  <scope>provided</scope>
</dependency>

License

Copyright (c) 2017 Christian García

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.

Версии библиотеки

Версия
0.2.0
0.1.0