// 
// Decompiled by Procyon v0.6.0
// 

package org.bson.codecs.jsr310;

import org.bson.codecs.configuration.CodecConfigurationException;
import org.bson.BsonType;
import org.bson.BsonReader;
import org.bson.codecs.Codec;

abstract class DateTimeBasedCodec<T> implements Codec<T>
{
    long validateAndReadDateTime(final BsonReader reader) {
        final BsonType currentType = reader.getCurrentBsonType();
        if (!currentType.equals(BsonType.DATE_TIME)) {
            throw new CodecConfigurationException(String.format("Could not decode into %s, expected '%s' BsonType but got '%s'.", this.getEncoderClass().getSimpleName(), BsonType.DATE_TIME, currentType));
        }
        return reader.readDateTime();
    }
}
