AutoValue: Ignore Hash Equals Extension

AutoValue extension for ignoring a field in hashcodes and equals

Лицензия

Лицензия

Категории

Категории

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

Группа

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

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

auto-value-ignore-hash-equals
Последняя версия

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

1.1.4
Дата

Дата

Тип

Тип

jar
Описание

Описание

AutoValue: Ignore Hash Equals Extension
AutoValue extension for ignoring a field in hashcodes and equals
Ссылка на сайт

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

https://github.com/REggar/auto-value-ignore-hash-equals/
Система контроля версий

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

https://github.com/REggar/auto-value-ignore-hash-equals/

Скачать auto-value-ignore-hash-equals

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

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

Зависимости

compile (2)

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

test (3)

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

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

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

AutoValue: Ignore Hash Equals Extension Build Status

An extension for Google's AutoValue that omits @IgnoreHashEquals field values from hashCode() and equals().

Basic Usage

Include the extension in your project, define an @IgnoreHashEquals annotation, and apply it to any fields that you wish to be ignored from the generated hashCode and equals implementation.

@Retention(SOURCE)
@Target({METHOD, PARAMETER, FIELD})
public @interface IgnoreHashEquals {
}
@AutoValue
public abstract class User {
  public abstract String id();
  @IgnoreHashEquals public abstract String name();
}

When you call hashCode() or equals() any properties with @IgnoreHashEquals will be ignored from the calculation.

@IncludeHashEquals Usage

Include the extension in your project, define an @IncludeHashEquals annotation, and apply it to any fields that you wish to be included from the generated hashCode and equals implementation.

@Retention(SOURCE)
@Target({METHOD, PARAMETER, FIELD})
public @interface IncludeHashEquals {
}
@AutoValue
public abstract class User {
  @IncludeHashEquals public abstract String id();
  public abstract String name();
}

When you call hashCode() or equals() any properties without @IncludeHashEquals will be ignored from the calculation.

Download

Add a Gradle dependency:

apt 'com.github.reggar:auto-value-ignore-hash-equals:1.1.4'

(Using the android-apt plugin)

or Maven:

<dependency>
  <groupId>com.github.reggar</groupId>
  <artifactId>auto-value-ignore-hash-equals</artifactId>
  <version>1.1.4</version>
  <scope>provided</scope>
</dependency>

Snapshots of the development version are available in Sonatype's snapshots repository.

Notes

This library is heavily inspired by Square's AutoValue: Redacted Extension.

License

Copyright 2017 Robert Eggar.

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.

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

Версия
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0