/
DefaultComponentFactorySupplier.java
52 lines (42 loc) · 1.82 KB
/
DefaultComponentFactorySupplier.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package net.fortuna.ical4j.data;
import net.fortuna.ical4j.model.Component;
import net.fortuna.ical4j.model.ComponentFactory;
import net.fortuna.ical4j.model.component.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.Supplier;
public class DefaultComponentFactorySupplier implements Supplier<List<ComponentFactory<? extends Component>>> {
@Override
public List<ComponentFactory<? extends Component>> get() {
final List<ComponentFactory<? extends Component>> rfc5545 =
Arrays.asList(
new Daylight.Factory(),
new Standard.Factory(),
new VAlarm.Factory(),
new VEvent.Factory(),
new VFreeBusy.Factory(),
new VJournal.Factory(),
new VTimeZone.Factory(),
new VToDo.Factory());
// Availability
final List<ComponentFactory<? extends Component>> rfc7953 =
Arrays.asList(
new Available.Factory(),
new VAvailability.Factory());
// Eventpub
final List<ComponentFactory<? extends Component>> rfc9073 =
Arrays.asList(
new Participant.Factory(),
new VLocation.Factory(),
new VResource.Factory());
final List<ComponentFactory<? extends Component>> vvenueDraft =
Collections.singletonList(new VVenue.Factory());
final List<ComponentFactory<? extends Component>> factories = new ArrayList<>(rfc5545);
factories.addAll(rfc7953);
factories.addAll(rfc9073);
factories.addAll(vvenueDraft);
return factories;
}
}