# Defining functions, variables, and events

{% tabs %}
{% tab title="Function that returns nothing" %}

```java
@SimpleFunction(description = "Does a thing")
public void FunctionWithoutReturn() {
    // Code to execute here
}
```

{% endtab %}

{% tab title="Function that returns a value" %}

```java
@SimpleFunction(description = "Does a thing and returns a result")
public Object FunctionWithReturn() {
    // Code to execute here
    return whateverYouWantToHaveAsAReturnValue;
}
```

{% endtab %}

{% tab title="Normal variable" %}

```java
private Object someVariableValue;
@DesignerProperty
@SimpleProperty(description="Gets the value")
public Object someVariable(){
    return someVariableValue;
}
@DesignerProperty
@SimpleProperty(description="Sets the value")
public void someVariable(Object newValue){
    someVariableValue = newValue;
}
```

{% endtab %}

{% tab title="Variable only settable from designer" %}

```java
private Object someVariableValue;
@DesignerProperty
@SimpleProperty(description="Gets the value")
public Object someVariable(){
    return someVariableValue;
}
@DesignerProperty()
public void someVariable(Object newValue){
    someVariableValue = newValue;
}
```

{% endtab %}

{% tab title="Variable only accessible from code" %}

```java
private Object someVariableValue;
@SimpleProperty(description="Gets the value")
public Object someVariable(){
    return someVariableValue;
}
@SimpleProperty(description="Sets the value")
public void someVariable(Object newValue){
    someVariableValue = newValue;
}
```

{% endtab %}
{% endtabs %}
