Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Escape from Java

Escape from Java

Slides of the talk I gave at Kotlin Night Torino 2018

Avatar for Roberto Orgiu

Roberto Orgiu

June 08, 2018
Tweet

More Decks by Roberto Orgiu

Other Decks in Programming

Transcript

  1. Rob

  2. public class Model { private String property; private int anotherProperty;

    private float wowAnotherProperty; private double pleaseStahpDude; public String getProperty() { return property; } public void setProperty(String property) { this.property = property; } public int getAnotherProperty() { return anotherProperty; } public void setAnotherProperty(int anotherProperty) {
  3. } public void setAnotherProperty(int anotherProperty) { this.anotherProperty = anotherProperty; }

    public float getWowAnotherProperty() { return wowAnotherProperty; } public void setWowAnotherProperty(float wowAnotherProperty) this.wowAnotherProperty = wowAnotherProperty; } public double getPleaseStahpDude() { return pleaseStahpDude; } public void setPleaseStahpDude(double pleaseStahpDude) { this.pleaseStahpDude = pleaseStahpDude; } }
  4. public class Model { private String property; private int anotherProperty;

    private float wowAnotherProperty; private double pleaseStahpDude; public String getProperty() { return property; } public void setProperty(String property) { this.property = property; } public int getAnotherProperty() { return anotherProperty; } public void setAnotherProperty(int anotherProperty) { this.anotherProperty = anotherProperty; } public float getWowAnotherProperty() { return wowAnotherProperty; } public void setWowAnotherProperty(float wowAnotherProperty) { this.wowAnotherProperty = wowAnotherProperty; } public double getPleaseStahpDude() { return pleaseStahpDude; } public void setPleaseStahpDude(double pleaseStahpDude) { this.pleaseStahpDude = pleaseStahpDude; } }
  5. public class Model { private String property; public String getProperty()

    { return property; } public void setProperty(String property) { this.property = property; } }
  6. public class Model { private final String property; public Model(String

    property) { this.property = property; } public String getProperty() { return property; } }
  7. import android.support.annotation.Nullable; public class Model { private final @Nullable String

    property; public Model(@Nullable String property) { this.property = property; } @Nullable public String getProperty() { return property; } }
  8. public class Model implements Parcelable{ private final @Nullable String property;

    public Model(@Nullable String property) { this.property = property; } protected Model(Parcel in) { property = in.readString(); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(property); } @Override public int describeContents() { return 0; } public static final Creator<Model> CREATOR = new Creator<Model>() { @Override public Model createFromParcel(Parcel in) { return new Model(in); } @Override public Model[] newArray(int size) { return new Model[size]; } }; @Nullable public String getProperty() { return property; } }