Skip to content

AccountShippingCountryComparator

msrivastav13 edited this page Nov 10, 2023 · 3 revisions

AccountShippingCountryComparator

An example implementation of the Comparator Interface In this example we show how to sort all the accounts by their country names in alphabetical order

Implemented types

Comparator<Account>

Constructors

public AccountShippingCountryComparator()

No param constructor. Assigns sort order as ascending by default

public AccountShippingCountryComparator(AccountShippingCountryComparator order)

Constructor accepting sort order as ascending/descending. Use this constructor to control the sort order.

Parameters

Param Description
sortOrder

Properties

public orderSortOrder


Methods

public Integer compare(Account a1, Account a2)


Enums

SortOrder


Classes

ASCComparatorException

This exception class is for throwing a custom exception

Inheritance

ASCComparatorException


Clone this wiki locally