Question: Is this method signature valid?

```
public Boolean isBikeTyreFlat(){}

```

Note that I am trying to return an Object not a primitive here.

Thanks :)

Answer: 
In JavaBeans, the getter method for `boolean` can be `getXXX()` or `isXXX()`. Since `Boolean` is not a primitive type, a `getXXX()` is required. The `isXXX()` is only for the boolean primitive type (thanks @Kemoda).

Refer to [section 8.3.2 of the JavaBeans Specification](http://download.oracle.com/otndocs/jcp/7224-javabeans-1.01-fr-spec-oth-JSpec/).
I have to disagree with [this answer](https://stackoverflow.com/a/10189265/953327). I had this same question and wrote a quick test.

Given the JavaBean as:

```
package example;

public class FooBean {

    private Boolean published;

    public void setPublished(Boolean published) {
        this.published = published;
    }

    public Boolean isPublished() {
        return published;
    }

}

```

And a Main class that looks like:

```
package example;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;

public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {

        BeanInfo beanInfo = null;
        try {
            beanInfo = Introspector.getBeanInfo(FooBean.class);
        } catch (IntrospectionException e) {
            e.printStackTrace();
        }
        PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();

        for(PropertyDescriptor descriptor : propertyDescriptors){
            System.out.println("descriptor: " + descriptor);
            System.out.println("descriptor.getName(): " + descriptor.getName());
            System.out.println("descriptor.getReadMethod(): " + descriptor.getReadMethod());
        }

    }

}

```

The result of running the main class is:

```
descriptor: java.beans.PropertyDescriptor@1e746992
descriptor.getName(): class
descriptor.getReadMethod(): public final native java.lang.Class java.lang.Object.getClass()
descriptor: java.beans.PropertyDescriptor@c994fbad
descriptor.getName(): published
descriptor.getReadMethod(): null

```

If I change `FooBean.java` to look like this:

```
package example;

public class FooBean {

    private boolean published;

    public void setPublished(boolean published) {
        this.published = published;
    }

    public boolean isPublished() {
        return published;
    }

}

```

Then the resulting output is:

```
descriptor: java.beans.PropertyDescriptor@18072768
descriptor.getName(): class
descriptor.getReadMethod(): public final native java.lang.Class java.lang.Object.getClass()
descriptor: java.beans.PropertyDescriptor@1e2ff4ad
descriptor.getName(): published
descriptor.getReadMethod(): public boolean example.FooBean.isPublished()

```

This tells me that for it to be a valid JavaBeans signature, the type must be declared a primitive boolean value.

**Edit**
Upon further testing it appears that just the declared return type of the isXxx() method must be boolean for JavaBeans to recognize it:

```
package example;

public class FooBean {

    private Boolean published;

    public void setPublished(Boolean published) {
        this.published = published;
    }

    public boolean isPublished() {
        return published;
    }

}

```

Result:

```
descriptor: java.beans.PropertyDescriptor@1e746992
descriptor.getName(): class
descriptor.getReadMethod(): public final native java.lang.Class java.lang.Object.getClass()
descriptor: java.beans.PropertyDescriptor@f96377e5
descriptor.getName(): published
descriptor.getReadMethod(): public boolean example.FooBean.isPublished()

```