<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package lib::sql::type::AbstractType;
use strict;

sub new
{
    my $class = shift;
    $class = ref $class || $class;

    return bless { @_ }, $class;
}


sub not_null
{
    my $self = shift;
    $self-&gt;{not_null} = shift || return $self-&gt;{not_null};
}


sub to_sql
{
    my $self  = shift;

    if ($self-&gt;not_null) { return $self-&gt;_to_sql . " NOT NULL" }
    else                 { return $self-&gt;_to_sql               }
}


sub _to_sql
{
    my $self = shift;
    my $class = ref $self;
    my ($junk, $name) = $class =~ /(.*)::(.*)/;
    return uc $name;
}


sub freeze
{
    my $self  = shift;
    my $class = ref $self;
    return "new " . $class . " ( " . (join ", ", map { "$_ =&gt; $self-&gt;{$_}" } keys %{$self}) . " )";
}


sub equals
{
    my $self   = shift;
    my $object = shift;
    return ref $self eq ref $object;
}


1;
</pre></body></html>