| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.google.common.collect.testing.features; |
| 18 |
|
| 19 |
import com.google.common.annotations.GwtCompatible; |
| 20 |
import com.google.common.collect.testing.Helpers; |
| 21 |
import java.lang.annotation.Inherited; |
| 22 |
import java.lang.annotation.Retention; |
| 23 |
import java.lang.annotation.RetentionPolicy; |
| 24 |
import java.util.List; |
| 25 |
import java.util.Set; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
@SuppressWarnings("unchecked") |
| 34 |
@GwtCompatible |
| 35 |
public enum ListFeature implements Feature<List> { |
| 36 |
SUPPORTS_SET, |
| 37 |
SUPPORTS_ADD_WITH_INDEX(CollectionFeature.SUPPORTS_ADD), |
| 38 |
SUPPORTS_REMOVE_WITH_INDEX(CollectionFeature.SUPPORTS_REMOVE), |
| 39 |
|
| 40 |
GENERAL_PURPOSE( |
| 41 |
CollectionFeature.GENERAL_PURPOSE, |
| 42 |
SUPPORTS_SET, |
| 43 |
SUPPORTS_ADD_WITH_INDEX, |
| 44 |
SUPPORTS_REMOVE_WITH_INDEX), |
| 45 |
|
| 46 |
|
| 47 |
REMOVE_OPERATIONS(CollectionFeature.REMOVE_OPERATIONS, SUPPORTS_REMOVE_WITH_INDEX); |
| 48 |
|
| 49 |
private final Set<Feature<? super List>> implied; |
| 50 |
|
| 51 |
ListFeature(Feature<? super List>... implied) { |
| 52 |
this.implied = Helpers.copyToSet(implied); |
| 53 |
} |
| 54 |
|
| 55 |
@Override |
| 56 |
public Set<Feature<? super List>> getImpliedFeatures() { |
| 57 |
return implied; |
| 58 |
} |
| 59 |
|
| 60 |
@Retention(RetentionPolicy.RUNTIME) |
| 61 |
@Inherited |
| 62 |
@TesterAnnotation |
| 63 |
public @interface Require { |
| 64 |
ListFeature[] value() default {}; |
| 65 |
|
| 66 |
ListFeature[] absent() default {}; |
| 67 |
} |
| 68 |
} |