# Consolidating Getter Functions

**URL:** <https://forum.kirupa.com/t/consolidating-getter-functions/281856>\
**Category:** flash\
**Created:** [February 13, 2009, 9:47pm UTC](https://forum.kirupa.com/t/consolidating-getter-functions/281856 "2009-02-13T21:47:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alpha\_Remex](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Alpha\_Remex](https://forum.kirupa.com/u/Alpha_Remex)\
**Post date:** [February 13, 2009, 9:47pm UTC](https://forum.kirupa.com/t/consolidating-getter-functions/281856/1 "2009-02-13T21:47:36Z")

</div>

Just asking out of curiosity here…

I have a custom event listener that saves about 10 different passed in values, and so I have 10 different “getter” functions that return those values.

I don’t want to make the variables public because that’s bad OOP.

But… I would like to consolidate all of these “getter” functions into one “getter” function, if possible.

The problem I’m running into is that I need to set the function return value to a “getter” function. Example:

```auto

public function someFunction():Boolean {
    return someInstanceBooleanValue;
}

```

I want to do this for type checking purposes so I can guard against erroneous assignments…  
Thoughts?
