Given a class:
public class BoolTest {private Boolean aBoolean;private String aString;
public Boolean isABoolean() {return aBoolean;}
public void setABoolean(Boolean value) {this.aBoolean = value;}
public String getAString() {return aString;}
public void setAString(String aString) {this.aString = aString;}}
Test:
(def example (BoolTest.))
(defn run-test [](do(-> example(.setABoolean true))(-> example(.setAString "something"))(from-java example)))
Actual:(test/run-test) => {:AString "something"}
Expected:(test/run-test) => {:AString "something" :ABoolean true}
The
is
convention in Java beans only applies to the primitive
boolean
type, not to the boxed
Boolean
type so this is the expected behavior, not a bug.
Given a class:
public class BoolTest {
private Boolean aBoolean;
private String aString;
public Boolean isABoolean() {
return aBoolean;
}
public void setABoolean(Boolean value) {
this.aBoolean = value;
}
public String getAString() {
return aString;
}
public void setAString(String aString) {
this.aString = aString;
}
}
Test:
(def example (BoolTest.))
(defn run-test []
(do
(-> example
(.setABoolean true))
(-> example
(.setAString "something"))
(from-java example)))
Actual:
(test/run-test) => {:AString "something"}
Expected:
(test/run-test) => {:AString "something" :ABoolean true}