> For the complete documentation index, see [llms.txt](https://nosicode.gitbook.io/faq/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nosicode.gitbook.io/faq/beginner/how-to-order-a-list-by-a-columm-java.md).

# How to order a list by a columm (java)

Let's imagine in a page called PartilhaGeral, that you have a List<> for type **Partilhageral.Table\_1**

```java
List<Partilhageral.Table_1> tablePart = new ArrayList<Partilhageral.Table_1>();
```

Steps to fill in you controller to order the list:

{% code title="using lambda" %}

```java
tablePart.sort(Comparator.comparing(Partilhageral.Table_1::getEstado))
```

{% endcode %}

or

```java
//In import reserved area:
import java.util.Collections;
import java.util.Comparator;

//In reserved code area after the set ot tablePart list add:
Collections.sort(tablePart,new SortbyStatus());

//At the end of your controller in custom_actions area add this class:
class SortbyStatus implements Comparator<Partilha.Table_1> {
        public int compare(Partilhageral.Table_1 a, Partilhageral.Table_1 b) {
            return b.getEstado() - a.getEstado();
        }
}


```
