Groovy web console

subscribe to the feed Subscribe
to this


Published 2 months ago by abc
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class Dimension {
    String name
    String toString() { name }

class Kpi {
    String name
    boolean isCalculated
    String toString() { name }

def dim1 = new Dimension(name: "dim1")
def dim2 = new Dimension(name: "dim2")
def kpi1 = new Kpi(name: "kpi1", isCalculated: true)
def kpi2 = new Kpi(name: "kpi2", isCalculated: false)

def columns = [dim1, dim2, kpi1, kpi2]
println columns.findAll {
    !(it instanceof Kpi && it.isCalculated)