1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.arch.persistence.room.vo 18 19 /** 20 * Internal representation of supported warnings 21 */ 22 enum class Warning(val publicKey: String) { 23 ALL("ALL"), 24 CURSOR_MISMATCH("ROOM_CURSOR_MISMATCH"), 25 MISSING_JAVA_TMP_DIR("ROOM_MISSING_JAVA_TMP_DIR"), 26 CANNOT_CREATE_VERIFICATION_DATABASE("ROOM_CANNOT_CREATE_VERIFICATION_DATABASE"), 27 PRIMARY_KEY_FROM_EMBEDDED_IS_DROPPED("ROOM_EMBEDDED_PRIMARY_KEY_IS_DROPPED"), 28 INDEX_FROM_EMBEDDED_FIELD_IS_DROPPED("ROOM_EMBEDDED_INDEX_IS_DROPPED"), 29 INDEX_FROM_EMBEDDED_ENTITY_IS_DROPPED("ROOM_EMBEDDED_ENTITY_INDEX_IS_DROPPED"), 30 INDEX_FROM_PARENT_IS_DROPPED("ROOM_PARENT_INDEX_IS_DROPPED"), 31 INDEX_FROM_PARENT_FIELD_IS_DROPPED("ROOM_PARENT_FIELD_INDEX_IS_DROPPED"), 32 RELATION_TYPE_MISMATCH("ROOM_RELATION_TYPE_MISMATCH"), 33 MISSING_SCHEMA_LOCATION("ROOM_MISSING_SCHEMA_LOCATION"), 34 MISSING_INDEX_ON_FOREIGN_KEY_CHILD("ROOM_MISSING_FOREIGN_KEY_CHILD_INDEX"); 35 36 companion object { <lambda>null37 val PUBLIC_KEY_MAP = Warning.values().associateBy { it.publicKey } fromPublicKeynull38 fun fromPublicKey(publicKey: String): Warning? { 39 return PUBLIC_KEY_MAP[publicKey.toUpperCase()] 40 } 41 } 42 } 43