GithubHelp home page GithubHelp logo

Comments (11)

gabrielittner avatar gabrielittner commented on August 10, 2024 3

Added a failing test for this https://github.com/gabrielittner/auto-value-with/tree/prefixes
I'll try to get a fix out later this week.

from auto-value-with.

toadzky avatar toadzky commented on August 10, 2024

Any word on this? This is causing a problem with Android's databinding because it requires bean-style getters.

from auto-value-with.

gabrielittner avatar gabrielittner commented on August 10, 2024

The snapshot is out now, a proper release will be out later today.

from auto-value-with.

toadzky avatar toadzky commented on August 10, 2024

i see the test. is there a fix in that PR? i didn't see one when i looked at it. it's still broken for me in 1.2

from auto-value-with.

gabrielittner avatar gabrielittner commented on August 10, 2024

The fix was part of #17. Can you give me a sample that doesn't work?

from auto-value-with.

toadzky avatar toadzky commented on August 10, 2024

want a whole project or just a file?

from auto-value-with.

gabrielittner avatar gabrielittner commented on August 10, 2024

Just pasting the file in here is enough.

from auto-value-with.

toadzky avatar toadzky commented on August 10, 2024

truncated stacktrace:

Error:(14, 17) error: @AutoValue processor threw an exception: java.lang.IllegalArgumentException: com.itworks.mobile.terminator.models.MailingAddress doesn't have property with name street which is required for withStreet()
at com.gabrielittner.auto.value.with.AutoValueWithExtension.getWithMethods(AutoValueWithExtension.java:65)
at com.gabrielittner.auto.value.with.AutoValueWithExtension.applicable(AutoValueWithExtension.java:108)
at com.google.auto.value.processor.AutoValueProcessor.processType(AutoValueProcessor.java:372)
at com.google.auto.value.processor.AutoValueProcessor.process(AutoValueProcessor.java:143)
...

class definition:

package datamodels;

import com.google.auto.value.AutoValue;

import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.os.Parcelable;
import android.support.annotation.Nullable;

/**
 * Created by toadzky on 4/28/16.
 */
@AutoValue
public abstract class MailingAddress extends BaseObservable implements Parcelable {

  public static final MailingAddress EMPTY = MailingAddress.builder().build();

  @Bindable
  public abstract String getStreet();

  @Bindable
  @Nullable
  public abstract String getAdditional();

  @Bindable
  public abstract String getCity();

  @Bindable
  public abstract String getDistrict();

  @Bindable
  public abstract String getCountry();

  @Bindable
  public abstract String getPostal();

  public abstract MailingAddress withStreet(String update);

  public abstract MailingAddress withAdditional(String update);

  public abstract MailingAddress withCity(String update);

  public abstract MailingAddress withDistrict(String update);

  public abstract MailingAddress withCountry(String update);

  public abstract MailingAddress withPostal(String update);

  private Builder toBuilder() {
    return new AutoValue_MailingAddress.Builder(this);
  }

  public static Builder builder() {
    return new AutoValue_MailingAddress.Builder();
  }

  @AutoValue.Builder
  public abstract static class Builder {
    public abstract Builder street(String street);

    public abstract Builder additional(String additional);

    public abstract Builder city(String city);

    public abstract Builder district(String district);

    public abstract Builder country(String country);

    public abstract Builder postal(String postal);

    public abstract MailingAddress build();

  }

}

from auto-value-with.

gabrielittner avatar gabrielittner commented on August 10, 2024

Does it work when you remove implements Parcelable?

from auto-value-with.

toadzky avatar toadzky commented on August 10, 2024

Yes. I'm using the auto-value-parcel extension as well. I guess it's an interaction between extensions.

from auto-value-with.

gabrielittner avatar gabrielittner commented on August 10, 2024

Someone else ran into that issue with auto-value-parcel + auto+value-gson. I've posted a workaround in that issue rharter/auto-value-parcel#47

from auto-value-with.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.