@interface Foo : NSObject { Bar *_bar; } @property (retain) Bar *bar; @end @implementation Foo @synthesize bar = _bar; - (void)dealloc { [_bar release]; [super dealloc]; } @end
149 chars
public class Foo { private Bar bar; public Bar getBar() { return bar; } public void setBar(Bar bar) { this.bar = bar; } }
98 chars
public class Foo {
private Bar bar;
public Bar getBar() {
return bar;
}
public void setBar(Bar bar) {
this.bar = bar;
}
}
98 chars
public final class Foo { private final Bar bar; public Bar getBar() { return bar; } public Foo(Bar bar) { this.bar = bar; } }
101 chars
public final class Foo { private final Bar bar; public Bar getBar() { return bar; } public Foo(Bar bar) { this.bar = bar; } }
101 chars
@AutoValue
public abstract class Foo {
public abstract Bar getBar();
public static Foo create(Bar bar) {
return new AutoValue_Foo(bar);
}
}
119 chars
public final class Foo { private final Bar bar; public Bar getBar() { return bar; } public Foo(Bar bar) { this.bar = bar; } }
101 chars
@Value
public class Foo {
Bar bar;
}
29 chars
@Value public class Foo { Bar bar; }
29 chars
class Foo { Bar bar }
16 chars
@Immutable
class Foo {
Bar bar
}
26 chars