Questions tagged [auto-value]

Immutable value type code generation for Java 1.6+.

AutoValue, a part of Google's open source auto project, makes creating immutable value type classes in Java easy.

Documentation can be found here.

118 questions
0
votes
0 answers

Using both @AutoMatter and @AutoValue in a same project

Recently I ran into the situation that I had to use both @AutoMatter and @AutoValue to generate code in a project. However this did not work as code was not generated for one of the class annotated (@Automatter). If this is a compiler plugin, why…
user_1357
  • 7,766
  • 13
  • 63
  • 106
0
votes
1 answer

Problems compiling AutoValue library example project

I just discovered google's AutoValue library, which seems great. I'm trying to compile the example project which I downloaded from here But the project doesn't compile. The compiler complains about the AutoValue_ constructor symbol not being…
Nir Brachel
  • 413
  • 3
  • 12
0
votes
0 answers

How to setup an ImmutableList with Auto-Value?

I try to setup an immutable list with Auto-Value. I followed the offical user-guide which recommends to implement something like that: @AutoValue public abstract class ListExample { public static ListExample create(String[] mutableNames) { …
GaborH
  • 689
  • 2
  • 11
  • 24
0
votes
1 answer

AutoValue : Missing required properties, when using auto-value-with extension

I'm using AutoValue with auto-value-with extension to create a slightly altered object. My class is : @AutoValue public abstract class FeedItem implements Parcelable { public abstract String getAccountId(); public abstract String getName(); public…
Mes
  • 1,671
  • 3
  • 20
  • 36
0
votes
0 answers

It is possible to generate Builder using google auto-value outside class?

I have class and builder for it. Builder would be used only in test code and I would like not to have it in production code. My class: public class MyClassThatIWantBuilderFor { // many fields that I want initialize using builder instead of 10 arg…
pixel
  • 24,905
  • 36
  • 149
  • 251
0
votes
1 answer

FreeBuilder in an Android Studio Java module

I want to use FreeBuilder in a Java module in Android Studio. I added the following dependency in the module dependencies: compile 'org.inferred:freebuilder:1.10.5' Then I created the following class: @FreeBuilder public abstract class MyClass { …
bplpu
  • 464
  • 4
  • 21
0
votes
1 answer

Objectify with Google AutoValue

I want to use auto value with objectify model entity. Objectify requires @Id annotation with a field value however in Google AutoValue all fields need to be converted to abstract methods, so I can't apply @Id to a abstract method. What is your…
krialix
  • 125
  • 2
  • 2
  • 6
0
votes
1 answer

How to decrement Auto column or Field by one using UPDATE SET on LibreOffice Base?

I have a table with auto increment column (ID) and have already filled my table with records. Then, after sometime I noticed that the auto increment (ID) column started from 2 instead of 1. I really wanted the count to start from 1. So, what I want…
ThN
  • 3,235
  • 3
  • 57
  • 115
0
votes
1 answer

Print auto-value object as Java source code

I often find myself wanting to copy a living java object into my tests (in the source code). I doubt this is generally doable, but perhaps a asJavaSourceCode() method could be generated for all @AutoValue objects? Here is some code to demonstrate…
Tarrasch
  • 10,199
  • 6
  • 41
  • 57
0
votes
1 answer

Saving firebase ServerValue.TIMESTAMP on AutoValue POJOs

Android chat crashes on DataSnapshot.getValue() for timestamp I'm trying to add a timestamp property to my POJO. The solution above tells jackson to ignore the real data member which is used by the application. I'm using AutoValue and can't figure…
Vinay Nagaraj
  • 1,162
  • 14
  • 26
0
votes
1 answer

Is it possible to use @AutoValue with Guice's FactoryModuleBuilder?

Per https://github.com/google/guice/wiki/AssistedInject, Lets say I have an interface A, implementing class AImpl and another interface AFactory that I use with the FactoryModuleBuilder - .. install(new FactoryModuleBuilder() …
0cd
  • 1,729
  • 3
  • 15
  • 24
0
votes
1 answer

Maven, break build on autovalue package usage

Autovalue includes a shadowed version of guava for the annotation processor stuff. The problem is that autocomplete will often pull the autovalue guava version of a package in instead of the actual guava package. What is the best way to prevent…
Cogman
  • 2,070
  • 19
  • 36
-1
votes
1 answer

Multiple inheritance quagmire - which class is instantiated?

Supposing I have the following classes: abstract class A { static abstract class _Foo {} } class B extends A { static void doSomething() { System.out.println(C.saySomething()); } static _Foo getInner() { return new…
smac89
  • 39,374
  • 15
  • 132
  • 179
1 2 3 4 5 6 7
8